#include <iostream>
using namespace std;
int main() {
int x[18]= {0,10,1,22,6,123,12,1124,40,11125,30,111126,84,1111127,224,11111128,144,111111129};
int n;
cin>>n;
cout<<x[2*n-2]<<" "<<x[2*n-1];
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgeFsxOF09IHswLDEwLDEsMjIsNiwxMjMsMTIsMTEyNCw0MCwxMTEyNSwzMCwxMTExMjYsODQsMTExMTEyNywyMjQsMTExMTExMjgsMTQ0LDExMTExMTEyOX07CglpbnQgbjsKCWNpbj4+bjsKCWNvdXQ8PHhbMipuLTJdPDwiICI8PHhbMipuLTFdOwoJcmV0dXJuIDA7Cn0=