Easy game? P23374


Statement
 

pdf   zip

html

Petr and Tourist are playing an interesting game called Easy. Initially there are n tokens, which are taken away by alternating turns with the following rules:

  1. Petr plays first, and he cannot take away all the tokens in the first turn.
  2. In each of the remaining turns the player cannot take away more tokens than those removed in the last turn.
  3. The player that manages to take away the last token wins.

Since the players of this game are bad programmers, they need your help. Given n, who will win the game assuming perfect play?

Input

Input consists of several cases, each with an n between 2 and 106.

Output

For every n, print the name of the winner.

Public test cases
  • Input

    2
    3
    4
    1000000
    

    Output

    Tourist
    Petr
    Tourist
    Petr
    
  • Information
    Author
    Ivan Geffner
    Language
    English
    Official solutions
    C++
    User solutions
    C C++
    Event
    Dotzè Concurs de Programació de la UPC - Semifinal
    Date
    2014-07-02