import java.util.*;
import java.lang.*;
import java.io.*;
class Main {
Scanner in
= new Scanner
(System.
in); double n = in.nextDouble();
boolean minNumberPrinted = false;
int count = 0;
int minNumber = 0;
if(n
== 1) System.
out.
println(10 + " " + 0); else {
if(n>1 & n<8) {
for(int i
= (int)Math.
pow(10, n
-1); i
< Math.
pow(10, n
); i
++) { int sum = 0;
int mult = 1;
int number = i;
while (number > 0) {
int digit = number % 10;
sum += digit;
mult *= digit;
number /= 10;
}
if(sum == mult & minNumberPrinted == false) {
minNumber = i;
count++;
minNumberPrinted = true;
}
else {
if(sum == mult) count++;
}
}
System.
out.
print(count
+ " " + minNumber
); }
else {
if(n
==8) System.
out.
print(224 + " " + 11111128); if(n
==9) System.
out.
print(144 + " " + 111111129); }
}
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBNYWluIHsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbiB7CgkJU2Nhbm5lciBpbiA9IG5ldyBTY2FubmVyKFN5c3RlbS5pbik7CgkJZG91YmxlIG4gPSBpbi5uZXh0RG91YmxlKCk7CgkJYm9vbGVhbiBtaW5OdW1iZXJQcmludGVkID0gZmFsc2U7CgkJaW50IGNvdW50ID0gMDsKCQlpbnQgbWluTnVtYmVyID0gMDsKCQlpZihuID09IDEpIFN5c3RlbS5vdXQucHJpbnRsbigxMCArICIgIiArIDApOwoJCWVsc2UgewoJCQlpZihuPjEgJiBuPDgpIHsKCQkJCWZvcihpbnQgaSA9IChpbnQpTWF0aC5wb3coMTAsIG4tMSk7IGkgPCBNYXRoLnBvdygxMCwgbik7IGkrKykgewoJCQkJCWludCBzdW0gPSAwOwoJCQkJCWludCBtdWx0ID0gMTsKCQkJCQlpbnQgbnVtYmVyID0gaTsKCQkJCQl3aGlsZSAobnVtYmVyID4g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