Problem Statement
We have a string $S$ of length $N$ consisting of 0, $\ldots$, 9, and a string $X$ of length $N$ consisting of A and T. Additionally, there is a string $T$, which is initialized to an empty string.
Takahashi and Aoki will play a game using these. The game consists of $N$ rounds. In the $i$-th round $(1\leq i \leq N)$, the following happens:
- If
$X_i$isA, Aoki does the operation below; if$X_i$isT, Takahashi does it. - Operation: append
$S_i$or0at the end of$T$.
After $N$ operations, $T$ will be a string of length $N$ consisting of 0, $\ldots$, 9. If $T$ is a multiple of $7$ as a base-ten number (after removing leading zeros), Takahashi wins; otherwise, Aoki wins.
Determine the winner of the game when the two players play optimally.
Constraints
$1 \leq N \leq 2\times 10^5$$S$and$X$have a length of$N$each.$S$consists of0,$\ldots$,9.$X$consists ofAandT.
Input
Input is given from Standard Input in the following format:
N
S
X
Output
If Takahashi wins when the two players play optimally, print Takahashi; if Aoki wins, print Aoki.
样例
2
35
AT
Takahashi
5
12345
AAAAT
Aoki
5
67890
TTTTA
Takahashi
5
12345
ATATA
Aoki
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。