#include using namespace std; //repetition #define FOR(i,a,b) for(ll i=(a);i<(b);++i) #define rep(i, n) for(ll i = 0; i < (ll)(n); i++) //container util #define all(x) (x).begin(),(x).end() //typedef typedef long long ll; typedef vector VI; typedef vector VVI; typedef vector VLL; typedef vector VVLL; typedef vector VS; typedef pair PII; typedef pair PLL; //const value //const ll MOD = 1e9 + 7; //const int dx[] = {0,1,0,-1};//{0,0,1,1,1,-1,-1,-1}; //const int dy[] = {1,0,-1,0};//{1,-1,0,1,-1,0,1,-1}; //conversion inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;} inline ll toLL(string s) {ll v; istringstream sin(s);sin>>v;return v;} template inline string toString(T x) {ostringstream sout;sout<> n; bool prime[n+101]; memset(prime, true, sizeof(prime)); prime[0] = false; prime[1] = false; for(int i = 2; i * i < n + 101; i++){ if(prime[i] == false) continue; int x = 2; while(x*i < n+101){ prime[i*x] = false; x++; } } prime[0] = true; prime[1] = true; FOR(i,n-100,n+101){ if(prime[i]) continue; else{ cout << i << endl; return 0; } } return 0; }