#include<iostream> #include<cstdio> #include<cstring> using namespace std; const int N = 100001; int mark[N],prime[N],cont=0; void prime_table() { memset(mark,0,sizeof(mark)); mark[0] = mark[1] = 1; for(long long i=2;i<N;i++) { if(mark[i]) continue; prime[++cont] = i; for(long long j=i;j*i<N;j++) mark[i*j] = 1; } } int main() { prime_table(); for(int i=1;i<=500;i++) { for(int j=1;j<=cont;j++) { int flag = 0; for(int k=0;k<=9;k++) { if(mark[prime[j]+i*k] || (prime[j]+i*k)>=N) { flag=1; break; } } if(flag == 0) { printf("%d %d %d ",prime[j],j,i); break; } } } }