stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
/*

confirm 0LL and 1LL

confirm cornercases such as 0

confirm times of cin < 10^6

*/

#include <bits/stdc++.h>

using namespace std;

using ll = long long;

using ld = long double;

using P = pair<ll, ll>;

using Pld = pair<ld, ld>;

using Vec = vector<ll>;

using VecP = vector<P>;

using VecB = vector<bool>;

using VecC = vector<char>;

using VecD = vector<ld>;

using VecS = vector<string>;

using VecVec = vector<Vec>;

using Graph = vector<VecP>;

template <typename T>

using Vec1 = vector<T>;

template <typename T>

using Vec2 = vector<Vec1<T> >;

#define REP(i, m, n) for(ll (i) = (m); (i) < (n); ++(i))

#define REPN(i, m, n) for(ll (i) = (m); (i) <= (n); ++(i))

#define REPR(i, m, n) for(ll (i) = (m)-1; (i) >= (n); --(i))

#define REPNR(i, m, n) for(ll (i) = (m); (i) >= (n); --(i))

#define rep(i, n) REP(i, 0, n)

#define repn(i, n) REPN(i, 1, n)

#define repr(i, n) REPR(i, n, 0)

#define repnr(i, n) REPNR(i, n, 1)

#define all(s) (s).begin(), (s).end()

#define pb push_back

#define mp make_pair

#define fs first

#define sc second

template <typename T>

bool chmax(T &a, const T& b){if(a < b){a = b; return true;} return false;}

template <typename T>

bool chmin(T &a, const T& b){if(a > b){a = b; return true;} return false;}

template <typename T>

void co(const T n){cout << n << endl;}

template <typename T>

void cosp(const T n){cout << n << ' ';}

void coVec(const Vec &v){for(ll i : v) cosp(i); cout << endl;}

ll in(){ll x; cin >> x; return x;}

void sonic(){ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);}

void setp(const ll n){cout << fixed << setprecision(n);}

const ll INF = 1e9+1;

const ll LINF = 1e18+1;

const ll MOD = 1e9+7;

//const ll MOD = 998244353;

const ld PI = acos(-1);

const ld EPS = 1e-11;



int main(void){

	sonic();

	ll n, m;

	cin >> n >> m;

	Vec x(n), y(m);

	rep(i, n) cin >> x[i];

	rep(i, m) cin >> y[i];



	ll sumx = 0;

	rep(i, n){

		sumx += x[i]*(i*2-(n-1));

		sumx %= MOD;

	}

	ll sumy = 0;

	rep(i, m){

		sumy += y[i]*(i*2-(m-1));

		sumy %= MOD;

	}

	co(sumx*sumy%MOD);



	return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>

#define MOD 1000000007



int main(void){

	long i, j, n, m;

	scanf("%ld %ld", &n, &m);

	long x[n], y[m];

	for(i = 0; i < n; i++) scanf("%ld", &x[i]);

	for(i = 0; i < m; i++) scanf("%ld", &y[i]);



	long sumx = 0;

	for(i = 0; i < n; i++){

		sumx += x[i]*(i*2-(n-1));

		if(sumx > 1e18 || sumx < -1e18) sumx %= MOD;

	}

	sumx %= MOD;

	long sumy = 0;

	for(i = 0; i < m; i++){

		sumy += y[i]*(i*2-(m-1));

		if(sumy > 1e18 || sumy < -1e18) sumy %= MOD;

	}

	sumy %= MOD;

	printf("%ld\n", sumx*sumy%MOD);



	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;



int main()

{

    char c;

    cin>>c;

    if(c>='A'&&c<='Z')cout<<'A';

    else cout<<'a';

    return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>



int main(){

	char huruf;

	scanf("%c",&huruf);

	huruf >='A'&&huruf<='Z' ? printf("A\n") : printf("a\n");

//	if (huruf >='A' && huruf <='Z'){

//		printf("A\n");

//	}

//	else{

//		printf("a");

//	}

//	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h> 



using namespace std;



int main()

{

	char ch;

	cin >> ch;

	if(isupper(ch)) cout << "A\n";

	else cout << "a\n";

	return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

int main (){

 

 char huruf [100];

 int i;

 scanf("%c", &huruf);



 if(huruf[i] >= 'A' && huruf [i] <= 'Z'){

  puts("A");

 }

  else{

   puts("a");

  }

 

 return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<string>

using namespace std;

int main(void)

{

    char ch;

    cin>>ch;

    if(ch>='A' && ch<='Z')

    {

        cout<<"A"<<endl;



    }

    else

        {

        cout<<"a"<<endl;



    }



}

// Optimized solution to the same problem (faster):
#include <stdio.h>

int main (){

 

 char huruf [100];

 int i;

 scanf("%c", &huruf);



 if(huruf[i] >= 'A' && huruf [i] <= 'Z'){

  puts("A");

 }

  else{

   puts("a");

  }

 

 return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;



int main(){



    char a;



    cin >> a;



    if('A'<= a && a<='Z')

        cout << "A" << endl;

    else

        cout << "a" << endl;





}


// Optimized solution to the same problem (faster):
#include <stdio.h>

int main (){

 

 char huruf [100];

 int i;

 scanf("%c", &huruf);



 if(huruf[i] >= 'A' && huruf [i] <= 'Z'){

  puts("A");

 }

  else{

   puts("a");

  }

 

 return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

using namespace std;

int main(){

	char tmp;

	cin >> tmp;

	if(tmp>='A' && tmp <='Z')

		cout << 'A' << endl;

	else

		cout << 'a' << endl;

	

	return 0;

} 

// Optimized solution to the same problem (faster):
#include <stdio.h>



int main (){

	char huruf[10];

	scanf ("%c", &huruf );

	

	int i=0;

 	if(huruf[i] >= 'A'&& huruf[i]<= 'Z') {

    puts ("A");

  }

   else {

    puts ("a");

  }

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    char ch;

    while(cin>>ch)

    {

        if(ch>='A' && ch<='Z')

        {

            cout<<"A"<<endl;

        }

        else

        {

            cout<<"a"<<endl;

        }

    }

}


// Optimized solution to the same problem (faster):
#include <stdio.h>



int main() {

    char a;

    scanf("%c", &a);

    if (a >= 'A' && a <= 'Z') puts("A");

    else puts("a");

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main()

{

    char str[100];

   cin >> str;

    int i,len=0;

    i=0;

    while(str[i]!='\0')

    {

        i++;

        len++;

    }

    for(i=0;i<len;i++)

    {

        if(str[i]>='A'&&str[i]<='Z')

        {

            cout << "A";

        }

        else

        {

            cout << "a";

        }

    }

}


// Optimized solution to the same problem (faster):
#include <stdio.h>



int main() {

    char a;

    scanf("%c", &a);

    if (a >= 'A' && a <= 'Z') puts("A");

    else puts("a");

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

using ll = long long int;

int main()

{

	char c;

	cin>>c;

	cout<<(isupper(c)?'A':'a')<<"\n";

}

// Optimized solution to the same problem (faster):
#include <stdio.h>



int main() {

    char a;

    scanf("%c", &a);

    if (a >= 'A' && a <= 'Z') puts("A");

    else puts("a");

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
//Let's play once again :)

#include<bits/stdc++.h>

using namespace std;



#define tarzan ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

#define int long long 



int rr[] = {0, 1, 1, 1, 0, -1, -1, -1};

int cc[] = {1, 1, 0, -1, -1, -1, 0, 1};



const int mod = 1e9 + 7;

const int N = 300050;



signed main()

{

    //freopen("input.txt", "r", stdin);

    //freopen("output.txt", "w", stdout);

    tarzan;

    int test = 1;

    //cin >> test;

    while(test--) {

        char ch;

        cin >> ch;



        if(ch >= 'A' && ch <= 'Z') {

            cout << 'A';

        }

        else cout << 'a';

    }

    return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>



int main() {

    char a;

    scanf("%c", &a);

    if (a >= 'A' && a <= 'Z') puts("A");

    else puts("a");

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main()

{

    char che;

    while(cin>>che)

    {

        int cnt=0;

        for(char i='A';i<='Z';i++)

        {

            if(che==i)

            {

                cnt=1;

                break;

            }



        }

        if(cnt==1)

            cout<<"A"<<endl;

        else

            cout<<"a"<<endl;

    }

}


// Optimized solution to the same problem (faster):
#include <stdio.h>



int main() {

	char a;

	scanf("%c", &a);

	if(a >= 'A' && a <= 'Z'){

		puts ("A");

	}

	else{

		puts ("a");

	}

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#define mx 100001

#define tc int t;cin>>t;for(int raf=1;raf<=t;raf++)

#define fm cout<<"Case "<<raf<<": "

using namespace std;

bool prime[100005];

void sieve()

{

	int n=100004;

	int p=sqrt(n);

	for(int i=4;i<=n;i+=2)prime[i]=1;

	for(int i=3;i<=p;i+=2){

		if(!prime[i])

		{

			for(int j=i*i;j<=n;j+=i) prime[j]=1;

		}

	}

	prime[1]=1;



}

int main()

{

    int b,c,d,e,f,i,j,n;

    cin>>n;

    sieve();

    for(i=n;;i++)

    {

        if(!prime[i])

        {

            cout<<i<<endl;

            break;

        }

    }

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>//khata



int isPrime(int n)

{

    int i;



    if(n <= 1)

        return 0;

    for(i=2; i*i <= n; i++)

    {

        if(n%i == 0)

            return 0;

    }

    return 1;

}



int finding_prime(int n)

{

    while(isPrime(n) != 1)

    {

        n++;

    }



    return n;

}



int main()

{

    int x, returned;



    scanf("%d", &x);



    returned = isPrime(x);



    if(returned == 1)

        printf("%d\n", x);



    else if(returned == 0)

    {

        x=finding_prime(x);

    }



    if(returned == 0)

        printf("%d\n", x);



    return 0;

}












// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;



void solve(){

    long long count, n;

    cin>>n;

    while(true){

        count = 0;

        for(long i = 2; i < n; i++){

            if(n % i == 0){

                count++;

                break;

            }

        }

        if(count == 0){

            cout<<n;

            break;

        }

        n++;

    }

    

}



int main(){

    solve();

    return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>//khata



int isPrime(int n)

{

    int i;



    if(n <= 1)

        return 0;

    for(i=2; i*i <= n; i++)

    {

        if(n%i == 0)

            return 0;

    }

    return 1;

}



int finding_prime(int n)

{

    while(isPrime(n) != 1)

    {

        n++;

    }



    return n;

}



int main()

{

    int x, returned;



    scanf("%d", &x);



    returned = isPrime(x);



    if(returned == 1)

        printf("%d\n", x);



    else if(returned == 0)

    {

        x=finding_prime(x);

    }



    if(returned == 0)

        printf("%d\n", x);



    return 0;

}












// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include<string>

#include<cmath>

#include<vector>

using std::cin;

using std::cout;

using std::vector;

int prime(int n)

{

	int flag=0,i,j;

	for(i=n;;i++)

	{

		flag=1;

		for(j=2;j*j<=n;j++)

		{

			if(i%j==0){

				flag=0;

				break;

			}

		}

		if(1==flag)

			break;

	}

	return i;

}

int main(){

	int n;

	cin>>n;

	cout<<prime(n);

	return 0;

}

			


// Optimized solution to the same problem (faster):
#include<stdio.h>//khata



int isPrime(int n)

{

    int i;



    if(n <= 1)

        return 0;

    for(i=2; i*i <= n; i++)

    {

        if(n%i == 0)

            return 0;

    }

    return 1;

}



int finding_prime(int n)

{

    while(isPrime(n) != 1)

    {

        n++;

    }



    return n;

}



int main()

{

    int x, returned;



    scanf("%d", &x);



    returned = isPrime(x);



    if(returned == 1)

        printf("%d\n", x);



    else if(returned == 0)

    {

        x=finding_prime(x);

    }



    if(returned == 0)

        printf("%d\n", x);



    return 0;

}












// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>



using namespace std;

using namespace __gnu_pbds;



#define Q int t; scanf("%d", &t); for(int q=1; q<=t; q++)

typedef long long int lli;

typedef pair<int, int> pi;

#define oset tree<int, null_type,greater<int>, rb_tree_tag,tree_order_statistics_node_update>



bool isprime(int n)

{

    bool fl = false;

    for(int i=2; i*i<=n; i++){

        if(n%i == 0){

            fl = true;

            break;

        }

    }

    return fl;

}



int main()

{

    int n;

    cin >> n;

    while(isprime(n)){

        n++;

    }

    cout << n;



    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>//khata



int isPrime(int n)

{

    int i;



    if(n <= 1)

        return 0;

    for(i=2; i*i <= n; i++)

    {

        if(n%i == 0)

            return 0;

    }

    return 1;

}



int finding_prime(int n)

{

    while(isPrime(n) != 1)

    {

        n++;

    }



    return n;

}



int main()

{

    int x, returned;



    scanf("%d", &x);



    returned = isPrime(x);



    if(returned == 1)

        printf("%d\n", x);



    else if(returned == 0)

    {

        x=finding_prime(x);

    }



    if(returned == 0)

        printf("%d\n", x);



    return 0;

}












// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main(){

    int t,i,p=0,j,ans;

    cin>>t;

    if(t==2){

        cout<<"2"<<endl;

    }

    else{

    i=t;

    while(1){

            for(j=2;j<i;j++){

        if(i%j==0){

            p++;

        }}

    if(p==0){

            ans=i;

            goto e;

    }

    p=0;

i++;}



e:

    cout<<ans<<endl;}

}


// Optimized solution to the same problem (faster):
#include<stdio.h>//khata



int isPrime(int n)

{

    int i;



    if(n <= 1)

        return 0;

    for(i=2; i*i <= n; i++)

    {

        if(n%i == 0)

            return 0;

    }

    return 1;

}



int finding_prime(int n)

{

    while(isPrime(n) != 1)

    {

        n++;

    }



    return n;

}



int main()

{

    int x, returned;



    scanf("%d", &x);



    returned = isPrime(x);



    if(returned == 1)

        printf("%d\n", x);



    else if(returned == 0)

    {

        x=finding_prime(x);

    }



    if(returned == 0)

        printf("%d\n", x);



    return 0;

}












// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;



int main()

{

    int x;

    scanf("%d",&x);

    for(int i=2;i<x/2;i++)

    {

        if(x%i==0)

        {

            x++;

            i=1;

            continue;

        }



    }

    printf("%d",x);

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>//khata



int isPrime(int n)

{

    int i;



    if(n <= 1)

        return 0;

    for(i=2; i*i <= n; i++)

    {

        if(n%i == 0)

            return 0;

    }

    return 1;

}



int finding_prime(int n)

{

    while(isPrime(n) != 1)

    {

        n++;

    }



    return n;

}



int main()

{

    int x, returned;



    scanf("%d", &x);



    returned = isPrime(x);



    if(returned == 1)

        printf("%d\n", x);



    else if(returned == 0)

    {

        x=finding_prime(x);

    }



    if(returned == 0)

        printf("%d\n", x);



    return 0;

}












// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

using namespace std;

bool isPrime(int num);



int main()

{

	ios_base::sync_with_stdio(false);

	cin.tie(NULL);

	int x;

	cin>>x;

	bool a=true, b;

	while(a)

	{

		b=isPrime(x);

		if(!b)	x++;

		else

		{

			cout<<x;

			a=false;

		}

	}

}

bool isPrime(int num)

{

	bool flag = true;

	for (int i = 2; i <= num / 2; i++)

	{

		if (num % i == 0)

		{

			flag = false;

			break;

		}

	}

	return flag;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>//khata



int isPrime(int n)

{

    int i;



    if(n <= 1)

        return 0;

    for(i=2; i*i <= n; i++)

    {

        if(n%i == 0)

            return 0;

    }

    return 1;

}



int finding_prime(int n)

{

    while(isPrime(n) != 1)

    {

        n++;

    }



    return n;

}



int main()

{

    int x, returned;



    scanf("%d", &x);



    returned = isPrime(x);



    if(returned == 1)

        printf("%d\n", x);



    else if(returned == 0)

    {

        x=finding_prime(x);

    }



    if(returned == 0)

        printf("%d\n", x);



    return 0;

}












// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<bits/stdc++.h>

using namespace std;



bitset<100010> prime;

const int ub = 100003;



void sieve()

{

    prime.set();

    prime[0] = prime[1] = 0;



    for(int I = 4; I<=ub; I+=2)

    {

        prime[I] = 0;

    }



    for(int I = 3; I*I<=ub; I+=2)

    {

        if(prime[I])

        {

            for(int J = I*I; J<=ub; J+=I)

            {

                prime[J] = 0;

            }

        }

    }



}



int main()

{

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);



    sieve();

    int N;

    cin>>N;

    while(!prime[N])N++;

    cout<<N<<endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>//khata



int isPrime(int n)

{

    int i;



    if(n <= 1)

        return 0;

    for(i=2; i*i <= n; i++)

    {

        if(n%i == 0)

            return 0;

    }

    return 1;

}



int finding_prime(int n)

{

    while(isPrime(n) != 1)

    {

        n++;

    }



    return n;

}



int main()

{

    int x, returned;



    scanf("%d", &x);



    returned = isPrime(x);



    if(returned == 1)

        printf("%d\n", x);



    else if(returned == 0)

    {

        x=finding_prime(x);

    }



    if(returned == 0)

        printf("%d\n", x);



    return 0;

}












// Fastest known solution for this problem:
// Original C++ solution (slower):
/* Ahmed Maher ( Acro_14 ) */

#include <bits/stdc++.h>

typedef long long ll;

const ll oo = 0x3f3f3f3f;

int const N = 1e5+5;

using namespace std;

//string alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ";

//string BN(ll x){bool f=0;string Bn;int i=62;while(i--){if ((ll)x & (1LL << i)){Bn+='1';f=1;}else{if(f)Bn+='0';}}return Bn;}//Decimal to Binary converter

 int n = N;

int ans[664580];

int *Seive(){

    vector<bool> good(n);

    for(int i = 1; i < n; i++){

        good[i] = true;

    }

    good[1] = false;

    for(ll i = 2; i < n; i++){

        if(good[i]){

            // i = 1e7

            for(ll j = 1LL * i * i; j < n; j += i){

                good[j] = false;

            }

        }

    }

    int j=0;

    for(int i = 1; i < n; i++){

        if(good[i]){

           ans[j]=i;

           j++;

        }

    }

    return ans;

/*to print */

//    int *p;

//    p=Seive();

//      for(int i=0;i<10e7;i++){

//      cout << *(p + i) << endl;

//      system("pause");

//   }

/*end of print*/

}



int main()

{

    int *p,arr[N];

    p=Seive();

    for(int i=0;i<N;i++)arr[i] = *(p + i);

    int x;

    cin>>x;

        for (int i=0;i<N;i++){

            if (arr[i]>x && arr[i-1]<x){cout<<arr[i]<<endl;break;}

            else if (arr[i]==x){cout<<x<<endl;break;}

        }

}



//       int anss[t+1];

//            anss[j]=ans;

//     for(int j=1;j<=t;j++) printf("Case %d: %d\n",j,anss[j]);


// Optimized solution to the same problem (faster):
///e. next prime

#include <stdio.h>

#include <math.h>



int isPrime(int a)

{

    if(a==2) return 1;

    for(int i=2;i<=sqrt(a);i++){

        if(a%i==0) return 0;

    }

    return 1;

}

int main()

{

    int x;

    scanf("%d",&x);



    for(int i=x;;i++){

        if(isPrime(i)==1) {

            printf("%d",i);

            break;

        }

    }

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

typedef long long ll;

using namespace std;

int xx;

bool is_prime(ll x){

if(x<=1) return 0;

for(int i=2;i*i<=x;i++){

    if(x%i==0)return 0;

}

return 1;

}

int main(){

ll x;

cin>>x;

while(true){

    if(is_prime(x)){

        cout<< x << "\n";

        return 0;

    }

    x++;

}

return 0;



}




// Optimized solution to the same problem (faster):
///e. next prime

#include <stdio.h>

#include <math.h>



int isPrime(int a)

{

    if(a==2) return 1;

    for(int i=2;i<=sqrt(a);i++){

        if(a%i==0) return 0;

    }

    return 1;

}

int main()

{

    int x;

    scanf("%d",&x);



    for(int i=x;;i++){

        if(isPrime(i)==1) {

            printf("%d",i);

            break;

        }

    }

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>



using namespace std;



bool prime(int x)

{

	if(x==2) return true;

	if(x<2 || x%2==0)

	return false;

	int root=sqrt(x);

	for(int i=3;i<=root;i+=2)

	{

		if(x%i==0)

		return false;

	}

	return true;

}

int main()

{

     int x;

     cin>>x;

     while(1)

     {

        bool res = prime(x);

     	if(res)

     	{

     		cout<<x;

     		return 0;

		}

		x++;

	 }   

}

// Optimized solution to the same problem (faster):
///e. next prime

#include <stdio.h>

#include <math.h>



int isPrime(int a)

{

    if(a==2) return 1;

    for(int i=2;i<=sqrt(a);i++){

        if(a%i==0) return 0;

    }

    return 1;

}

int main()

{

    int x;

    scanf("%d",&x);



    for(int i=x;;i++){

        if(isPrime(i)==1) {

            printf("%d",i);

            break;

        }

    }

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

#define rep(i,n) for(int i=0; i<n; i++)

typedef long long ll;





int main(){

    int x;

    cin >> x;

    int n = 200000;

    vector<int> seive(200001);

    for(int i=2; i*i<=n; i++){

        int cnt = 2;

        while(i*cnt <= n){

            seive[i*cnt]++;

            cnt++;

        }

    }

    vector<int> prime;

    for(int i=2; i<n; i++){

        if(seive[i]==0) prime.push_back(i);

    }

    auto itr = lower_bound(prime.begin(),prime.end(),x);

    cout << *itr << endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;

#define rep(i,n) for(int i=0; i<n; i++)

typedef long long ll;





int main(){

    int x;

    cin >> x;

    int n = 100300;

    vector<int> seive(100301);

    for(int i=2; i*i<=n; i++){

        int cnt = 2;

        while(i*cnt <= n){

            seive[i*cnt]++;

            cnt++;

        }

    }

    vector<int> prime;

    for(int i=2; i<n; i++){

        if(seive[i]==0) prime.push_back(i);

    }

    auto itr = lower_bound(prime.begin(),prime.end(),x);

    cout << *itr << endl;

    return 0;

}

// Fastest known solution for this problem: