#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main() {
srand(time(0));
int r;
int iter = 0;
int seven = 0;
while (true) {
r = rand() % 1000 + 100;
iter++;
if (r % 10 == 7) {
cout << r << endl;
seven++;
}
if (iter == 1000 || seven == 15) {
break;
}
}
return 0;
}