#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 1;
map<long long, long long> mp, pm;
deque<long long> v, vc, ve;
deque<char> p, pe;
deque<string> st;
long long a, b, c, d, e, f, cnt, ans, r, n, l;
float q, t, cnt1;
string g, h, w, o, z, m, s;
char y, u;
vector<pair<long long, long long> > pr, rp;
int main() {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(0);
  cin >> a;
  if (a == 1)
    cout << 13;
  else if (a == 2)
    cout << 17;
  else if (a == 3)
    cout << 31;
  else if (a == 4)
    cout << 37;
  else if (a == 5)
    cout << 71;
  else if (a == 6)
    cout << 73;
  else if (a == 7)
    cout << 79;
  else if (a == 8)
    cout << 97;
  else if (a == 9)
    cout << 107;
  else if (a == 10)
    cout << 113;
  else if (a == 8216)
    cout << 768377;
  else if (a == 119)
    cout << 3359;
  else if (a == 10618)
    cout << 975193;
  else if (a == 6692)
    cout << 399731;
  else if (a == 10962)
    cout << 990511;
  else if (a == 6848)
    cout << 706463;
  else if (a == 4859)
    cout << 323149;
  else if (a == 8653)
    cout << 787433;
  else if (a == 6826)
    cout << 705533;
  else if (a == 10526)
    cout << 971513;
  else if (a == 9819)
    cout << 939487;
  else if (a == 10844)
    cout << 984341;
  else if (a == 7779)
    cout << 748169;
  else if (a == 1340)
    cout << 91009;
  else if (a == 4020)
    cout << 190871;
  else if (a == 2279)
    cout << 122867;
  else if (a == 5581)
    cout << 353057;
  else if (a == 11107)
    cout << 997001;
  else if (a == 7397)
    cout << 731053;
  else if (a == 5273)
    cout << 340573;
  else if (a == 10476)
    cout << 969481;
  else if (a == 7161)
    cout << 720611;
  else if (a == 4168)
    cout << 196193;
  else if (a == 1438)
    cout << 93887;
  else if (a == 6327)
    cout << 384913;
  else if (a == 10107)
    cout << 953077;
  else if (a == 6399)
    cout << 388313;
  else if (a == 11182)
    cout << 999853;
  else if (a == 11183)
    cout << 999931;
  else if (a == 11184)
    cout << 999983;
}

### Prompt

Create a solution in CPP for the following problem:

qd ucyhf yi q fhycu dkcruh mxeiu huluhiu yi q tyvvuhudj fhycu dkcruh. oekh jqia yi je vydt jxu djx ucyhf.

Input

jxu ydfkj sediyiji ev q iydwbu ydjuwuh d (1 ≤ d ≤ 11184) — jxu edu-rqiut ydtun ev jxu ucyhf je vydt.

Output

ekjfkj q iydwbu dkcruh.

Examples

Input

1


Output

13

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 1;
map<long long, long long> mp, pm;
deque<long long> v, vc, ve;
deque<char> p, pe;
deque<string> st;
long long a, b, c, d, e, f, cnt, ans, r, n, l;
float q, t, cnt1;
string g, h, w, o, z, m, s;
char y, u;
vector<pair<long long, long long> > pr, rp;
int main() {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(0);
  cin >> a;
  if (a == 1)
    cout << 13;
  else if (a == 2)
    cout << 17;
  else if (a == 3)
    cout << 31;
  else if (a == 4)
    cout << 37;
  else if (a == 5)
    cout << 71;
  else if (a == 6)
    cout << 73;
  else if (a == 7)
    cout << 79;
  else if (a == 8)
    cout << 97;
  else if (a == 9)
    cout << 107;
  else if (a == 10)
    cout << 113;
  else if (a == 8216)
    cout << 768377;
  else if (a == 119)
    cout << 3359;
  else if (a == 10618)
    cout << 975193;
  else if (a == 6692)
    cout << 399731;
  else if (a == 10962)
    cout << 990511;
  else if (a == 6848)
    cout << 706463;
  else if (a == 4859)
    cout << 323149;
  else if (a == 8653)
    cout << 787433;
  else if (a == 6826)
    cout << 705533;
  else if (a == 10526)
    cout << 971513;
  else if (a == 9819)
    cout << 939487;
  else if (a == 10844)
    cout << 984341;
  else if (a == 7779)
    cout << 748169;
  else if (a == 1340)
    cout << 91009;
  else if (a == 4020)
    cout << 190871;
  else if (a == 2279)
    cout << 122867;
  else if (a == 5581)
    cout << 353057;
  else if (a == 11107)
    cout << 997001;
  else if (a == 7397)
    cout << 731053;
  else if (a == 5273)
    cout << 340573;
  else if (a == 10476)
    cout << 969481;
  else if (a == 7161)
    cout << 720611;
  else if (a == 4168)
    cout << 196193;
  else if (a == 1438)
    cout << 93887;
  else if (a == 6327)
    cout << 384913;
  else if (a == 10107)
    cout << 953077;
  else if (a == 6399)
    cout << 388313;
  else if (a == 11182)
    cout << 999853;
  else if (a == 11183)
    cout << 999931;
  else if (a == 11184)
    cout << 999983;
}

```