B - Bouzu Mekuri Editorial /

Time Limit: 2 sec / Memory Limit: 1024 MB

配点 : 200200

問題文

NN 枚のカードからなる山札があります。
それぞれのカードは、「良いカード」か「悪いカード」かのどちらかです。

高橋君と青木君は、この山札を使って対戦ゲームをします。
このゲームでは、22 人は交互に山札の一番上のカードを引いて、そのカードを食べます。
先に悪いカードを食べたプレイヤーの負けです。(ここで、山札には少なくとも 11 枚の悪いカードが含まれていることが保証されます。)

01 からなる文字列 SS が与えられます。i=1,2,,Ni = 1, 2, \ldots, N について、

  • SSii 文字目が 0 のとき、山札の上から ii 番目のカードが良いカードであることを表します。
  • SSii 文字目が 1 のとき、山札の上から ii 番目のカードが悪いカードであることを表します。

高橋君が先手でゲームを始めるとき、高橋君と青木君のどちらが負けるかを答えてください。

制約

  • 1N1051 \leq N \leq 10^5
  • NN は整数
  • SS01 からなる長さ NN の文字列
  • SS は少なくとも 11 個の 1 を含む。

入力

入力は以下の形式で標準入力から与えられる。

NN
SS

出力

高橋君が先手でゲームを始めるとき、高橋君と青木君のどちらが負けるかを答えよ。
高橋君が負けるならば Takahashi 、青木君が負けるならば Aoki と出力せよ。


入力例 1Copy

Copy
5
00101

出力例 1Copy

Copy
Takahashi

まず、高橋君が良いカードを食べ、次に青木君が良いカードを食べ、その後に高橋君が悪いカードを食べます。
高橋君が先に悪いカードを食べるので高橋君が負けます。よって、Takahashi と出力します。


入力例 2Copy

Copy
3
010

出力例 2Copy

Copy
Aoki

Score : 200200 points

Problem Statement

We have a deck of NN cards.
Each of these cards is good or bad.

Using this deck, Takahashi and Aoki will play a game against each other.
In the game, the players alternately draw the topmost card and eat it.
The player who first gets to eat a bad card loses the game. (Here, it is guaranteed that the deck contains at least one bad card.)

You are given a string SS consisting of 0 and 1. For each i=1,2,,Ni = 1, 2, \ldots, N,

  • if the ii-th character of SS is 0, it means that the ii-th card from the top of the deck is good;
  • if the ii-th character of SS is 1, it means that the ii-th card from the top of the deck is bad.

Which player will lose when Takahashi goes first in the game?

Constraints

  • 1N1051 \leq N \leq 10^5
  • NN is an integer.
  • SS is a string of length NN consisting of 0 and 1.
  • SS contains at least one occurrence of 1.

Input

Input is given from Standard Input in the following format:

NN
SS

Output

Print the name of the player who will lose when Takahashi goes first in the game: Takahashi or Aoki.


Sample Input 1Copy

Copy
5
00101

Sample Output 1Copy

Copy
Takahashi

First, Takahashi will eat a good card. Next, Aoki will eat a good card. Then, Takahashi will eat a bad card.
Thus, Takahashi will be the first to eat a bad card, so we should print Takahashi.


Sample Input 2Copy

Copy
3
010

Sample Output 2Copy

Copy
Aoki


2025-04-17 (Thu)
08:04:51 +00:00