a;main(){a=!printf("&d",atoi(gets(&a))%123456);}