import sys import math #from collections import deque, defaultdict, Counter #import heapq #import bisect #import itertools #import functools # 外部ライブラリ(AtCoder環境で利用可能) #from sortedcontainers import SortedList, SortedSet, SortedDict #from atcoder.dsu import DSU #from atcoder.segtree import SegTree #from atcoder.lazysegtree import LazySegTree #from atcoder.fenwicktree import FenwickTree # 入力高速化 #input = sys.stdin.readline # 再帰回数上限 sys.setrecursionlimit(500000) # よくあるmod #MOD = 1000000007 MOD = 998244353 def solve(): # 解答ここから H, W = map(int, input().split(' ')) points = [0, 0] cur = (H + W + 1) % 2 # 0: sepa, 1: ryota while H > 1 and W > 1: if H < W: H, W = W, H H -= W points[cur] += W cur ^= 1 if H < W: H, W = W, H points[cur] += (H + 1) // 2 points[cur^1] += (H - (H + 1) // 2) if points[0] >= points[1]: print("sepa") else: print("ryota") if __name__ == '__main__': T = int(input()) for _ in range(T): solve()