{"problem":{"name":"Swap Hats","description":{"content":"There are three Takahashis numbered $1$, $2$ and $3$, and three hats colored red, green, and blue. Each Takahashi is wearing one hat. The color of the hat that Takahashi $i$ is currently wearing is re","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc244_d"},"statements":[{"statement_type":"Markdown","content":"There are three Takahashis numbered $1$, $2$ and $3$, and three hats colored red, green, and blue. Each Takahashi is wearing one hat. The color of the hat that Takahashi $i$ is currently wearing is represented by a character $S_i$. Here, `R` corresponds to red, `G` to green, and `B` to blue. Now, they will do the following operation **exactly** $10^{18}$ times.\n\n#### Operation\n\n*   Choose two out of the three Takahashis. The two exchange the hats they are wearing.\n\nIs it possible to make Takahashi $i$ wearing the hat of color corresponding to character $T_i$ after the $10^{18}$ repetitions?\n\n## Constraints\n\n*   $S_1, S_2, S_3$ are a permutation of `R`, `G`, `B`.\n*   $T_1, T_2, T_3$ are a permutation of `R`, `G`, `B`.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$S_1$ $S_2$ $S_3$\n$T_1$ $T_2$ $T_3$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc244_d","tags":[],"sample_group":[["R G B\nR G B","Yes\n\nFor example, the objective can be achieved by repeating $10^{18}$ times the operation of swapping the hats of Takahashi $1$ and Takahashi $2$."]],"created_at":"2026-03-03 11:01:14"}}