#include<cstdio> int main() { int n; int k=1,x=100; scanf("%d",&n); while(1) { if(x==0) { x=100; k++; } if(364*(3*x+k)==n) break; x--; } printf("%d\n%d",x,k); return 0; }