#include using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(0); int N; cin >> N; if(N == 1){ cout << 2 << '\n'; }else if(N == 2){ cout << 112 << '\n'; }else if(N == 3){ cout << 1401 << '\n'; }else if(N == 4){ cout << 3141 << '\n'; }else{ cout << 141 << '\n'; } }