#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <functional>
#include <set>
#include <queue>
#include <string>
#include <map>
#include <iomanip>
#include <sstream>
#include <cassert>

bool isprime(int n) {
    if (n == 1) {
        return false;
    }
    int count = 0, k = 2;
    while (k * k <= n && count == 0) {
        if (n % k == 0)
            count++;
        k++;
    }
    if (count == 0) return true;
    else return false;
}

class PrimeNumberGenerator {
 private:
    int start;
 public:
    explicit PrimeNumberGenerator(int start) {
        this->start = start;
    }

    int GetNextPrime() {
        while (isprime(start) == false) {
            this->start += 1;
        }
    this->start += 1;
    return start - 1;
    }
};