{"raw_statement":[{"iden":"problem statement","content":"You are given $N$ srings $S_i\\ (1\\le i \\le N)$ consisting of `A`, `B`, `C`, `D`.\nConsider the operation below on a string $T$ consisting of `A`, `B`, `C`, `D`.\n\n*   Repeat the following until $T$ contains none of the strings $S_i$ as a substring.\n    *   Choose an $S_i$ and one of its occurrences in $T$, remove that occurrence from $T$, and concatenate the remaining parts.\n\nWhat is a substring? A substring of a string is its contiguous subsequence. For example, `A`, `AB`, and `BC` are substrings of `ABC`, while `BA` and `AC` are not.We say that the string $T$ is _bad_ when multiple strings can result from the operation above.\nDetermine whether a bad string exists."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 10^6$\n*   $1 \\leq |S_i| \\leq 2 \\times 10^6$\n*   $|S_1|+|S_2|+\\dots +|S_N| \\leq 2 \\times 10^6$\n*   $S_i \\neq S_j$ if $i\\neq j$.\n*   $S_i$ is a string consisting of `A`, `B`, `C`, `D`."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$S_1$\n$S_2$\n$\\vdots$\n$S_N$"},{"iden":"sample input 1","content":"3\nA\nB\nC"},{"iden":"sample output 1","content":"No\n\nThe only string we can get from $T$ is what remains after removing all occurrences of `A`, `B`, `C` from $T$."},{"iden":"sample input 2","content":"1\nABA"},{"iden":"sample output 2","content":"Yes\n\nFor example, from $T=$ `ABABA`, we can get two strings: `AB` and `BA`, so $T$ is a bad string."},{"iden":"sample input 3","content":"4\nCBA\nACB\nAD\nCAB"},{"iden":"sample output 3","content":"Yes"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}