CF15C.Industrial Nim

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

There are nn stone quarries in Petrograd.

Each quarry owns mim_{i} dumpers ( 1<=i<=n1<=i<=n ). It is known that the first dumper of the ii -th quarry has xix_{i} stones in it, the second dumper has xi+1x_{i}+1 stones in it, the third has xi+2x_{i}+2 , and the mim_{i} -th dumper (the last for the ii -th quarry) has xi+mi1x_{i}+m_{i}-1 stones in it.

Two oligarchs play a well-known game Nim. Players take turns removing stones from dumpers. On each turn, a player can select any dumper and remove any non-zero amount of stones from it. The player who cannot take a stone loses.

Your task is to find out which oligarch will win, provided that both of them play optimally. The oligarchs asked you not to reveal their names. So, let's call the one who takes the first stone «tolik» and the other one «bolik».

输入格式

The first line of the input contains one integer number nn ( 1<=n<=1051<=n<=10^{5} ) — the amount of quarries. Then there follow nn lines, each of them contains two space-separated integers xix_{i} and mim_{i} ( 1<=xi,mi<=10161<=x_{i},m_{i}<=10^{16} ) — the amount of stones in the first dumper of the ii -th quarry and the number of dumpers at the ii -th quarry.

输出格式

Output «tolik» if the oligarch who takes a stone first wins, and «bolik» otherwise.

输入输出样例

  • 输入#1

    2
    2 1
    3 2
    

    输出#1

    tolik
    
  • 输入#2

    4
    1 1
    1 1
    1 1
    1 1
    

    输出#2

    bolik
    
首页