#include <stdio.h>
#define MAX_N 1000000
#define IS_PRIME 0
#define NOT_PRIME 1
int main(void)
{
int primeTable[MAX_N] = {1, 1};
long long i, j;
for (i = 2; i < MAX_N; ++i)
if (primeTable[i] == IS_PRIME)
for (j = i * i; j < MAX_N; j += i)
primeTable[j] = NOT_PRIME;
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiAKI2RlZmluZSBNQVhfTiAgICAgICAgICAgMTAwMDAwMAogCiNkZWZpbmUgSVNfUFJJTUUgICAgICAgIDAKI2RlZmluZSBOT1RfUFJJTUUgICAgICAgMQogCmludCBtYWluKHZvaWQpCnsKICAgIGludCBwcmltZVRhYmxlW01BWF9OXSA9IHsxLCAxfTsKICAgIGxvbmcgbG9uZyBpLCBqOwogICAgZm9yIChpID0gMjsgaSA8IE1BWF9OOyArK2kpCiAgICAgICAgaWYgKHByaW1lVGFibGVbaV0gPT0gSVNfUFJJTUUpCiAgICAgICAgICAgIGZvciAoaiA9IGkgKiBpOyBqIDwgTUFYX047IGogKz0gaSkKICAgICAgICAgICAgICAgIHByaW1lVGFibGVbal0gPSBOT1RfUFJJTUU7CiAKICAgIHJldHVybiAwOwp9