type = input() size = int(type[1]) a = 1189 b = 841 while(size): a = a/2 c = a;a = b;b = c size-=1 print(int(a)) print(int(b))