#include <iostream>
#include <algorithm>
#include <sstream>
class PrimeNumberGenerator {
public:
explicit PrimeNumberGenerator(int start) {
this->last = start;
}
int GetNextPrime() {
int n = this->last;
int i = 2, j = 0;
while (true) {
if (i * i <= n && j != 1) {
if (n % i == 0) {
j = 1;
i++;
} else {
i++;
}
} else if (j == 1) {
n++;
this->last++;
i = 2;
j = 0;
continue;
} else {
this->last++;
return n;
}
}
}
int last;
};