#include<cstdio>
#include<iostream>
using namespace std;
bool e;
int scan_d()
{
e=false;
int ip=getc(stdin),ret=0;
for(;ip<'0'||ip>'9';ip=getc(stdin))
{
if(ip==EOF)
{
e=true;
break;
}
}
if(!e)
{
for(;ip>='0'&&ip<='9';ip=getc(stdin))
ret=ret*10+ip-'0';
return ret;
}
}
int main()
{
while(!e)
{
int t=scan_d();
if(!e)
cout<<t<<endl;
}
if(e)
cout<<"end of file reached";
}
I2luY2x1ZGU8Y3N0ZGlvPgojaW5jbHVkZTxpb3N0cmVhbT4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKYm9vbCBlOwppbnQgc2Nhbl9kKCkKewogICAgZT1mYWxzZTsKICAgIGludCBpcD1nZXRjKHN0ZGluKSxyZXQ9MDsKICAgIGZvcig7aXA8JzAnfHxpcD4nOSc7aXA9Z2V0YyhzdGRpbikpCiAgICB7CiAgICAgICAgaWYoaXA9PUVPRikKICAgICAgICB7CiAgICAgICAgICAgIGU9dHJ1ZTsKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgfQogICAgfQogICAgaWYoIWUpCiAgICB7CiAgICAgICAgZm9yKDtpcD49JzAnJiZpcDw9JzknO2lwPWdldGMoc3RkaW4pKQogICAgICAgICAgICByZXQ9cmV0KjEwK2lwLScwJzsKICAgICAgICByZXR1cm4gcmV0OyAgICAKICAgIH0KfQppbnQgbWFpbigpCnsKICAgIHdoaWxlKCFlKQogICAgewogICAgICAgIGludCB0PXNjYW5fZCgpOwogICAgICAgIGlmKCFlKQogICAgICAgICAgICBjb3V0PDx0PDxlbmRsOwogICAgfQogICAgaWYoZSkKICAgICAgICBjb3V0PDwiZW5kIG9mIGZpbGUgcmVhY2hlZCI7Cn0=