# 사람들 풀이
N = int(input())
mod = 1_000_000_000
if N == 0:
print(0)
elif N < 0 and N % 2 == 0:
print(-1)
else:
print(1)
a, b = 0, 1
for i in range(abs(N)):
a, b = b, (a+b) % mod
print(a)
# 내 풀이
N = int(input())
mod = 1_000_000_000
ans = 0
if 0 == N:
b = 0
elif 0 < N:
a, b = 0, 1
for i in range(2, N+1):
a, b = b, (a + b) % mod
ans = b
elif N < 0:
a, b = 1, 0
for i in range(2, -N+3):
a, b = b, (a - b) % mod if i % 2 == 0 else (a - b) % mod - mod
ans = a
if ans == 0:
print(0)
elif ans > 0:
print(1)
elif ans < 0:
print(-1)
print(abs(ans))