#include <iostream>
#include <cmath>
using namespace std;
int Sum(int a) {
int sum=0;
while(a>0) {
sum+=a%10;
a/=10;
}
return sum;
}
int Mult(int a) {
int mult=1;
while(a>0) {
mult*=a%10;
a/=10;
}
return mult;
}
int main() {
int n,ch=0,sum=0,mult=0,a;
bool b=true;
cin>>n;
if(n==1) cout<<10<<" "<<0;
else {
if(n>1 and n<8) {
for(int i=pow(10,n-1); i<pow(10,n); i++) {
sum=Sum(i);
mult=Mult(i);
if((sum==mult) and b==true) {a=i;ch++;b=false;}
else {
if(sum==mult) ch++;
}
}
cout<<ch<<" "<<a;
}
else {
if(n==8) cout<<224<<" "<<11111128;
if(n==9) cout<<144<<" "<<111111129;
}
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgU3VtKGludCBhKSB7CglpbnQgc3VtPTA7Cgl3aGlsZShhPjApIHsKCQlzdW0rPWElMTA7CgkJYS89MTA7Cgl9CglyZXR1cm4gc3VtOwp9CgppbnQgTXVsdChpbnQgYSkgewoJaW50IG11bHQ9MTsKCXdoaWxlKGE+MCkgewoJCW11bHQqPWElMTA7CgkJYS89MTA7Cgl9CglyZXR1cm4gbXVsdDsKfQoKaW50IG1haW4oKSB7CglpbnQgbixjaD0wLHN1bT0wLG11bHQ9MCxhOwoJYm9vbCBiPXRydWU7CgljaW4+Pm47CglpZihuPT0xKSBjb3V0PDwxMDw8IiAiPDwwOwoJZWxzZSB7CgkJaWYobj4xIGFuZCBuPDgpIHsKCQkJZm9yKGludCBpPXBvdygxMCxuLTEpOyBpPHBvdygxMCxuKTsgaSsrKSB7CgkJCQlzdW09U3VtKGkpOwoJCQkJbXVsdD1NdWx0KGkpOwoJCQkJaWYoKHN1bT09bXVsdCkgYW5kIGI9PXRydWUpIHthPWk7Y2grKztiPWZhbHNlO30KCQkJCWVsc2UgewoJCQkJCWlmKHN1bT09bXVsdCkgY2grKzsKCQkJCX0KCQkJfQoJCQljb3V0PDxjaDw8IiAiPDxhOwoJCX0KCQllbHNlIHsKCQkJaWYobj09OCkgY291dDw8MjI0PDwiICI8PDExMTExMTI4OwoJCQlpZihuPT05KSBjb3V0PDwxNDQ8PCIgIjw8MTExMTExMTI5OwoJCX0KCX0KCXJldHVybiAwOwp9