#include<iostream>
#include<vector>
#include<cmath>
using namespace std;
vector<int> mul(vector<int> a,vector<int> b){
vector<int> res(a.size() + b.size() + 1,0);
for(int i = 0;i < a.size();i++){
for(int j = 0;j < b.size();j++){
res[i + j] += a[i] * b[j];
}
}
int c = 0;
for(int i = 0;i < res.size();i++){
int t = res[i] + c;
res[i] = t % 10;
c = t / 10;
}
while(c){
res.push_back(c % 10);
c /= 10;
}
if(res.size() > 500) res.resize(500);
while(res.size() < 100) res.push_back(0);
return res;
}
vector<int> po(int p){
vector<int> a,b;
a.push_back(1);
b.push_back(2);
while(p){
if(p % 2) a = mul(a,b);
b = mul(b,b);
p /= 2;
}
return a;
}
void out(vector<int> ans){
int c = 0;
for(int i = 1;i <= 10;i++){
for(int j = c,cnt = 1;cnt <= 50;j++,cnt++){
cout << ans[ans.size() - 1 - j];
}
c += 50;
cout << endl;
}
}
int main(){
int p;
cin >> p;
cout << floor(p * log10(2) + 1) << endl;
vector<int> ans = po(p);
if(ans.size() > 500) ans.resize(500);
while(ans.size() < 500) ans.push_back(0);
ans[0]--;
for(int i = 0;ans[i] < 0;i++){
ans[i] += 10,ans[i + 1]--;
}
out(ans);
return 0;
}