# 一共52周
week_num = 52
total_money = int(input())
week_money = total_money / week_num
flag = 1
for i in range(100,0,-1):
for j in range(1,int(week_money)):
if 7 * i + 21 * j == week_money:
print(i)
print(j)
flag =0
break
if flag == 0:
break