실버3 문제
def fib(n):
arr = [0] * (n+1)
arr[0] = [1, 0]
if (n >= 1):
arr[1] = [0, 1]
if (n >= 2):
for i in range(2, n+1):
arr[i] = [arr[i-1][0] + arr[i-2][0], arr[i-1][1] + arr[i-2][1]]
return arr[n]
t = int(input())
for _ in range(t):
n = int(input())
print(*fib(n))