Bouzu Mekuri

AtCoder
IDabc210_b
Time2000ms
Memory256MB
Difficulty
We have a deck of $N$ 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 $S$ consisting of `0` and `1`. For each $i = 1, 2, \ldots, N$, * if the $i$\-th character of $S$ is `0`, it means that the $i$\-th card from the top of the deck is good; * if the $i$\-th character of $S$ is `1`, it means that the $i$\-th card from the top of the deck is bad. Which player will **lose** when Takahashi goes first in the game? ## Constraints * $1 \leq N \leq 10^5$ * $N$ is an integer. * $S$ is a string of length $N$ consisting of `0` and `1`. * $S$ contains at least one occurrence of `1`. ## Input Input is given from Standard Input in the following format: $N$ $S$ [samples]
Samples
Input #1
5
00101
Output #1
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`.
Input #2
3
010
Output #2
Aoki
API Response (JSON)
{
  "problem": {
    "name": "Bouzu Mekuri",
    "description": {
      "content": "We have a deck of $N$ 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 ",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc210_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "We have a deck of $N$ cards.  \nEach of these cards is _good_ or _bad_.\nUsing this deck, Takahashi and Aoki will play a game against each other.  \nIn the game, the players alternately draw the topmost ...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments