#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#include <iostream>
using namespace std;
short ans[310000];
int main()
{
ios::sync_with_stdio(0);
int p;
cin>>p;
cout<<int(0.30103*p+1)<<endl;
ans[0]=1;
int jin=0;
for(int i=0;i<p;++i)
{
for(int j=0;j<5001;++j)
{
ans[j] = ans[j]+ans[j]+jin;
jin = ans[j]/10;
ans[j] = ans[j]%10;
}
}
ans[0]--;
int cnt10=0;
for(short i=499;i>=0;--i)
{
++cnt10;
cout<<ans[i];
if(cnt10==50)
{
cout<<endl;
cnt10=0;
}
}
return 0;
}