#include #include #include using namespace std; using LL = long long; using ULL = unsigned long long; LL P[]{ 100003, 100019, 100043, 100049, }; int main() { int N; cin >> N; vector ans; ans.push_back(1); for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { ans.push_back(P[i] * P[j]); } } sort(ans.begin(), ans.end()); cout << ans[N - 1] << endl; }