long s,n,M=1e12;main(i){for(s=scanf("%ld",&n);n%51/i;s=s*i++%M);printf(n<15?"%ld":"%012ld",i