#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>

int isprime(int num) {
    if (num == 1 || (num % 5 == 0) && (num != 5)) return false;
    if ((num % 11 == 0) && (num != 11)) return false;
    if ((num % 7 == 0) && (num != 7)) return false;
    if (num == 2 || num == 3) {
        return true;
    }
    if ((num * num) % 24 == 1) {
        return true;
    }
    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;
    }
};