long n;f(a,b,c,d){n--%4912?f(b,c%17,d,a+b+c+d):printf("%d\n",a);}main(i){for(;~scanf("%ld",&n);--i&&f(1,0,0,0));}