#include <iostream>
using namespace std;
int main() {
// your code goes here
int numberOfLines;
int m; //beginning of prime numbers
int n; //ending of prime numbers
int x;
int *arrayPtr;
//Read in the numbers
std::cin >> numberOfLines;
//Create an array with numberOfLines
for (int i = 0; i < numberOfLines; i++){
std::cin >> m >> n;
arrayPtr = new int[(n-m)+1];
int counter = 0;
//Check condition m >= 1 && n >=1
if (m >= 1 && n >= 1)
//check second condition
if ( m <= 1000000000 && n <= 1000000000)
//check third condition
if (n-m<= 100000){
for (int x = m; x <= n; x++){
if (x == 1){
}
else if (x == 2 || x == 3 || x == 5 || x == 7 || x == 11){
arrayPtr[counter] = x;
counter++;
}
else if (x%2 == 0 || x%3 == 0 || x%5 == 0 || x%7 == 0 || x%11 == 0)
{}
else
{
arrayPtr[counter] = x;
counter++;
}
}
}
for (int i = 0; i < counter; i++)
std::cout << arrayPtr[i] << "\n";
std::cout << "\n";
delete arrayPtr;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CgkvLyB5b3VyIGNvZGUgZ29lcyBoZXJlCglpbnQgbnVtYmVyT2ZMaW5lczsKCWludCBtOyAvL2JlZ2lubmluZyBvZiBwcmltZSBudW1iZXJzCglpbnQgbjsgLy9lbmRpbmcgb2YgcHJpbWUgbnVtYmVycwoJaW50IHg7CglpbnQgKmFycmF5UHRyOwoJLy9SZWFkIGluIHRoZSBudW1iZXJzIAoJc3RkOjpjaW4gPj4gbnVtYmVyT2ZMaW5lczsKCQoJLy9DcmVhdGUgYW4gYXJyYXkgd2l0aCBudW1iZXJPZkxpbmVzCglmb3IgKGludCBpID0gMDsgaSA8IG51bWJlck9mTGluZXM7IGkrKyl7CgkJc3RkOjpjaW4gPj4gbSA+PiBuOwoJCWFycmF5UHRyID0gbmV3IGludFsobi1tKSsxXTsKCQlpbnQgY291bnRlciA9IDA7CgkKCQkvL0NoZWNrIGNvbmRpdGlvbiBtID49IDEgJiYgbi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