P25307 [AtCoder] Stone Mountain Game
NOI
题目描述

Problem Description

Snuke and Rng often play games together. Today, they are playing a game using stones as follows:

  • Create two piles of stones, with $X$ stones in the first pile and $Y$ stones in the second pile.
  • Snuke goes first, followed by Rng, taking turns to remove stones. The player who reduces any pile to zero stones loses. The rules for removing stones are as follows:
  • First, let $k$ be the number of stones in the smaller pile.
  • Choose one of the piles and remove between 1 and $k$ stones.

When both players aim to win and adopt the optimal strategy, which player will win?

Input Format

The input is given from the standard input in the following format:

$ X $ $ Y $

  • The first line contains two integers $X,\ Y\ (1\ ≦\ X\ ≦\ 10^9,\ 1\ ≦\ Y\ ≦\ 10^9)$, representing the initial number of stones in each pile.

Output Format

If Snuke wins, output snuke. If Rng wins, output rng. End the output with a newline.

Sample Input and Output

Sample Input #1

4 2

Sample Output #1

snuke

Sample Input #2

1 999999999

Sample Output #2

rng

Sample Input #3

100 999999999

Sample Output #3

snuke

Notes/Hints

Sample Explanation 1

The game proceeds as follows:
- Snuke takes 2 stones from the first pile.
- Rng takes 1 stone from the first pile.
- Snuke takes 1 stone from the second pile.
- Rng takes 1 stone from the first pile, reducing it to 0 stones, resulting in Rng's loss and Snuke's win.

Sample Explanation 3

If Snuke takes 99 stones from the first pile on his first turn, it results in a situation similar to Sample Input #2, leading to Rng's loss and Snuke's win.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
4 2
样例输出
snuke