#include <iomanip>
#include <iostream>
#include <cstdio>
using namespace std;
int PR[ 168 ] = { 2 ,3 ,5 ,7 ,11 ,13 ,17 ,19 ,23 ,29 ,31 ,37 ,41 ,43 ,47 ,53 ,59 ,61 ,67 ,71 ,73 ,79 ,83 ,89 ,97 ,101 ,103 ,107 ,109 ,113 ,127 ,131 ,137 ,139 ,149 ,151 ,157 ,163 ,167 ,173 ,179 ,181 ,191 ,193 ,197 ,199 ,211 ,223 ,227 ,229 ,233 ,239 ,241 ,251 ,257 ,263 ,269 ,271 ,277 ,281 ,283 ,293 ,307 ,311 ,313 ,317 ,331 ,337 ,347 ,349 ,353 ,359 ,367 ,373 ,379 ,383 ,389 ,397 ,401 ,409 ,419 ,421 ,431 ,433 ,439 ,443 ,449 ,457 ,461 ,463 ,467 ,479 ,487 ,491 ,499 ,503 ,509 ,521 ,523 ,541 ,547 ,557 ,563 ,569 ,571 ,577 ,587 ,593 ,599 ,601 ,607 ,613 ,617 ,619 ,631 ,641 ,643 ,647 ,653 ,659 ,661 ,673 ,677 ,683 ,691 ,701 ,709 ,719 ,727 ,733 ,739 ,743 ,751 ,757 ,761 ,769 ,773 ,787 ,797 ,809 ,811 ,821 ,823 ,827 ,829 ,839 ,853 ,857 ,859 ,863 ,877 ,881 ,883 ,887 ,907 ,911 ,919 ,929 ,937 ,941 ,947 ,953 ,967 ,971 ,977 ,983 ,991 ,997 } ;
int AN[ 168 ] = { 0 } ;
int ana_std( int inn)
{
//int K= Prime.size();
int K= 168 ;
int ret= 0 ;
for ( int i= 0 ; PR[ i] <= inn && i< K; i++ )
{
int that= PR[ i] ;
while ( inn % that== 0 )
{
inn / = that;
AN[ i] + = 1 ;
if ( inn== 1 )
return ret;
}
}
if ( ret> 1 )
return ret;
else
return ( 1 ) ;
}
void ACM160( int N)
{
for ( int t= 0 ; t< 168 ; t++ )
{
AN[ t] = 0 ;
}
for ( int x= 2 ; x<= N; x++ )
{
ana_std( x) ;
}
//cout<<setw(3)<<setiosflags(ios::fixed)<<N<<"! =";
printf ( "%3d! = " ,N) ;
for ( int i= 0 ; i< 168 ; i++ )
{
if ( AN[ i] > 0 )
{
//cout <<setw(3)<<setiosflags(ios::fixed)<<AN[i];
printf ( "%3d" ,AN[ i] ) ;
if ( i== 14 )
{
if ( N== 100 )
cout << endl<< " " ;
else
cout << endl<< " " ;
}
} else
{
cout << endl;
break ;
}
}
}
int main( )
{ int N;
while ( cin >> N)
{
if ( N>= 2 && N<= 100 )
{
ACM160( N) ;
} else if ( N== 1 )
{
//cout<<setw(3)<<setiosflags(ios::fixed)<<N<<"! ="<<endl;
printf ( "%3d" ,N) ;
printf ( "! =\n " ) ;
continue ;
}
else
break ;
}
//getchar();
return 0 ;
}
I2luY2x1ZGUgPGlvbWFuaXA+CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPGNzdGRpbz4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKaW50IFBSWzE2OF09ezIsMyw1LDcsMTEsMTMsMTcsMTksMjMsMjksMzEsMzcsNDEsNDMsNDcsNTMsNTksNjEsNjcsNzEsNzMsNzksODMsODksOTcsMTAxLDEwMywxMDcsMTA5LDExMywxMjcsMTMxLDEzNywxMzksMTQ5LDE1MSwxNTcsMTYzLDE2NywxNzMsMTc5LDE4MSwxOTEsMTkzLDE5NywxOTksMjExLDIyMywyMjcsMjI5LDIzMywyMzksMjQxLDI1MSwyNTcsMjYzLDI2OSwyNzEsMjc3LDI4MSwyODMsMjkzLDMwNywzMTEsMzEzLDMxNywzMzEsMzM3LDM0NywzNDksMzUzLDM1OSwzNjcsMzczLDM3OSwzODMsMzg5LDM5Nyw0MDEsNDA5LDQxOSw0MjEsNDMxLDQzMyw0MzksNDQzLDQ0OSw0NTcsNDYxLDQ2Myw0NjcsNDc5LDQ4Nyw0OTEsNDk5LDUwMyw1MDksNTIxLDUyMyw1NDEsNTQ3LDU1Nyw1NjMsNTY5LDU3MSw1NzcsNTg3LDU5Myw1OTksNjAxLDYwNyw2MTM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