#include<iostream>
using namespace std;
const int n=3;
int main(){
int asdf,cnt;
cin>>asdf;
if(asdf>31||asdf<10) {
cout<<0;
return 0;
}
for(int a=1;a<=n;a++){
for(int b=1;b<=n;b++){
for(int c=1;c<=n;c++){
for(int d=1;d<=n;d++){
for(int e=1;e<=n;e++){
for(int f=1;f<=n;f++){
for(int g=1;g<=n;g++){
for(int h=1;h<=n;h++){
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
if(a+b+c+d+e+f+g+h+i+j==asdf)
cnt++;
}
}
}
}
}
}
}
}
}
}
cout<<cnt<<'\n';
for(int a=1;a<=n;a++){
for(int b=1;b<=n;b++){
for(int c=1;c<=n;c++){
for(int d=1;d<=n;d++){
for(int e=1;e<=n;e++){
for(int f=1;f<=n;f++){
for(int g=1;g<=n;g++){
for(int h=1;h<=n;h++){
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
if(a+b+c+d+e+f+g+h+i+j==asdf)
cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e<<' '<<f<<' '<<g<<' '<<h<<' '<<i<<' '<<j<<' '<<'\n';
}
}
}
}
}
}
}
}
}
}
return 0;
}