import java.util.*;
import java.lang.*;
import java.io.*;
class Main
{
{
Scanner in
= new Scanner
(System.
in); int[] x = {10,0,1,22,6,123,12,1124,40,11125,30,111126,84,1111127,224,11111128,144,111111129};
int n;
n = in.nextInt();
System.
out.
print(x
[2*n
-2] + " " + x
[2*n
-1]); }
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBNYWluCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCVNjYW5uZXIgaW4gPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwogICAgCWludFtdIHggPSB7MTAsMCwxLDIyLDYsMTIzLDEyLDExMjQsNDAsMTExMjUsMzAsMTExMTI2LDg0LDExMTExMjcsMjI0LDExMTExMTI4LDE0NCwxMTExMTExMjl9OwogICAgCWludCBuOwogICAgCW4gPSBpbi5uZXh0SW50KCk7CiAgICAJU3lzdGVtLm91dC5wcmludCh4WzIqbi0yXSArICIgIiArIHhbMipuLTFdKTsKCX0KfQkKCQ==