n = int(input())if (n-n//2000*200)>(n-n//1000*100): print(n-n//1000*100,end=" ") print(1)else: print(n-n//2000*200,end=" ") print(0)