$_=<>; if($_<5){ print+(1,12,65,172,297)[$_]; }else{ $_-=5; print+(456+176*$_+17*$_*$_)%1000000007; }