P13723 [GCPC 2024] Headline Heat

Description

The German ICPC scene is widely considered one of the most competitive. At least, that's what we tell our students. Countless rivalries form a complex web of envy, despair, glory, and triumph woven around and manifested in the unrelenting echoes of two scoreboards -- Winter Contest and GCPC. While generations of participants tend to forget the grudges of their predecessors, we coaches, acting as timeless beacons of continuity, preserve these petty conflicts between long forgotten teams. Striving for perfect balance, we express our dedication to our coaching duties in a furious outcry on social media against every unfair news article. That is, a coach gets mad if a news article is published that contains a rival university name more often than their own. :::align{center} ![](https://cdn.luogu.com.cn/upload/image_hosting/81caxzmt.png) Top 10 scoreboard of Winter Contest 2024. ::: To smoothen the waves of conflict in this ocean of rage, a newly appointed authority is tasked with proofreading media coverage of GCPC and Winter Contest to prevent uneven coverage.

Input Format

The input consists of: - One line with the number of universities $n$, rivalries $m$, and articles $k$. \\ ($1\leq n,m,k\leq 10^5$) - $n$ lines containing the name of a university $p_i$. - $m$ lines containing two integers $u,v$, meaning that universities $u$ and $v$ are rivals. \\ ($1\leq u,v \leq n, u\neq v$) - $k$ lines containing a news article $t_i$. If a university $u$ is a rival of university $v$, then $v$ is also a rival of $u$. Moreover, there are no duplicate rivalries. Names and articles are strings of lowercase Latin letters and spaces. The first and last character of a name or article are never a space. Names can overlap and be contained in other names. The summed length of all names and articles is at most $10^6$, i.e. $\sum_{i=1}^{n} |p_i| + \sum_{i=1}^{k} |t_i| \leq 10^6$.

Output Format

For each article, output "$\texttt{no}$" if it will draw the wrath of at least one coach and "$\texttt{yes}$" otherwise.