https://www.acmicpc.net/problem/1003
import sys
t = int(sys.stdin.readline())
dp = [(0, 0)]*41 # 0<=N<=40
dp[0] = (1, 0)
dp[1] = (0, 1)
for _ in range(t):
n = int(sys.stdin.readline())
for i in range(0, n+1):
# 이미 값이 등록되어 있으면
if dp[i] != (0, 0):
continue
dp[i] = (dp[i-1][0]+dp[i-2][0], dp[i-1][1]+dp[i-2][1])
print(dp[n][0], dp[n][1])