#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'counterGame' function below.
#
# The function is expected to return a STRING.
# The function accepts LONG_INTEGER n as parameter.
#
import math
def counterGame(n):
i=0
while True:
if n==1:
return "Richard" if i % 2 == 0 else 'Louise'
x=2**int(math.log(n,2))
if n==x:
n=n//2
else:
n=n-x
i+=1
# Write your code here
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
t = int(input().strip())
for t_itr in range(t):
n = int(input().strip())
result = counterGame(n)
fptr.write(result + '\n')
fptr.close()
Comments
Post a Comment