#include <cstdio>
using namespace std;
int main() {
int x;
scanf("%d",&x);
if(x>99991){printf("100003\n");return 0;}
else if(x>99989){printf("99991\n");return 0;}
else if(x>99971){printf("99989\n");return 0;}
else if(x>99961){printf("99971\n");return 0;}
else if(x>99929){printf("99961\n");return 0;}
else if(x>99923){printf("99929\n");return 0;}
else if(x>99907){printf("99923\n");return 0;}
else if(x>99901){printf("99907\n");return 0;}
else if(x>99881){printf("99901\n");return 0;}
else if(x>99877){printf("99881\n");return 0;}
else if(x>99871){printf("99877\n");return 0;}
else if(x>99859){printf("99871\n");return 0;}
else if(x>99839){printf("99859\n");return 0;}
else if(x>99833){printf("99839\n");return 0;}
else if(x>99829){printf("99833\n");return 0;}
else if(x>99823){printf("99829\n");return 0;}
else if(x>99817){printf("99823\n");return 0;}
else if(x>99809){printf("99817\n");return 0;}
else if(x>99793){printf("99809\n");return 0;}
else if(x>99787){printf("99793\n");return 0;}
else if(x>99767){printf("99787\n");return 0;}
else if(x>99761){printf("99767\n");return 0;}
else if(x>99733){printf("99761\n");return 0;}
else if(x>99721){printf("99733\n");return 0;}
else if(x>99719){printf("99721\n");return 0;}
else if(x>99713){printf("99719\n");return 0;}
else if(x>99709){printf("99713\n");return 0;}
else if(x>99707){printf("99709\n");return 0;}
else if(x>99689){printf("99707\n");return 0;}
else if(x>99679){printf("99689\n");return 0;}
else if(x>99667){printf("99679\n");return 0;}
else if(x>99661){printf("99667\n");return 0;}
else if(x>99643){printf("99661\n");return 0;}
else if(x>99623){printf("99643\n");return 0;}
else if(x>99611){printf("99623\n");return 0;}
else if(x>99607){printf("99611\n");return 0;}
else if(x>99581){printf("99607\n");return 0;}
else if(x>99577){printf("99581\n");return 0;}
else if(x>99571){printf("99577\n");return 0;}
else if(x>99563){printf("99571\n");return 0;}
else if(x>99559){printf("99563\n");return 0;}
else if(x>99551){printf("99559\n");return 0;}
else if(x>99529){printf("99551\n");return 0;}
else if(x>99527){printf("99529\n");return 0;}
else if(x>99523){printf("99527\n");return 0;}
else if(x>99497){printf("99523\n");return 0;}
else if(x>99487){printf("99497\n");return 0;}
else if(x>99469){printf("99487\n");return 0;}
else if(x>99439){printf("99469\n");return 0;}
else if(x>99431){printf("99439\n");return 0;}
else if(x>99409){printf("99431\n");return 0;}
else if(x>99401){printf("99409\n");return 0;}
else if(x>99397){printf("99401\n");return 0;}
else if(x>99391){printf("99397\n");return 0;}
else if(x>99377){printf("99391\n");return 0;}
else if(x>99371){printf("99377\n");return 0;}
else if(x>99367){printf("99371\n");return 0;}
else if(x>99349){printf("99367\n");return 0;}
else if(x>99347){printf("99349\n");return 0;}
else if(x>99317){printf("99347\n");return 0;}
else if(x>99289){printf("99317\n");return 0;}
else if(x>99277){printf("99289\n");return 0;}
else if(x>99259){printf("99277\n");return 0;}
else if(x>99257){printf("99259\n");return 0;}
else if(x>99251){printf("99257\n");return 0;}
else if(x>99241){printf("99251\n");return 0;}
else if(x>99233){printf("99241\n");return 0;}
else if(x>99223){printf("99233\n");return 0;}
else if(x>99191){printf("99223\n");return 0;}
else if(x>99181){printf("99191\n");return 0;}
else if(x>99173){printf("99181\n");return 0;}
else if(x>99149){printf("99173\n");return 0;}
else if(x>99139){printf("99149\n");return 0;}
else if(x>99137){printf("99139\n");return 0;}
else if(x>99133){printf("99137\n");return 0;}
else if(x>99131){printf("99133\n");return 0;}
else if(x>99119){printf("99131\n");return 0;}
else if(x>99109){printf("99119\n");return 0;}
else if(x>99103){printf("99109\n");return 0;}
else if(x>99089){printf("99103\n");return 0;}
else if(x>99083){printf("99089\n");return 0;}
else if(x>99079){printf("99083\n");return 0;}
else if(x>99053){printf("99079\n");return 0;}
else if(x>99041){printf("99053\n");return 0;}
else if(x>99023){printf("99041\n");return 0;}
else if(x>99017){printf("99023\n");return 0;}
else if(x>99013){printf("99017\n");return 0;}
else if(x>98999){printf("99013\n");return 0;}
else if(x>98993){printf("98999\n");return 0;}
else if(x>98981){printf("98993\n");return 0;}
else if(x>98963){printf("98981\n");return 0;}
else if(x>98953){printf("98963\n");return 0;}
else if(x>98947){printf("98953\n");return 0;}
else if(x>98939){printf("98947\n");return 0;}
else if(x>98929){printf("98939\n");return 0;}
else if(x>98927){printf("98929\n");return 0;}
else if(x>98911){printf("98927\n");return 0;}
else if(x>98909){printf("98911\n");return 0;}
else if(x>98899){printf("98909\n");return 0;}
else if(x>98897){printf("98899\n");return 0;}
else if(x>98893){printf("98897\n");return 0;}
else if(x>98887){printf("98893\n");return 0;}
else if(x>98873){printf("98887\n");return 0;}
else if(x>98869){printf("98873\n");return 0;}
else if(x>98867){printf("98869\n");return 0;}
else if(x>98849){printf("98867\n");return 0;}
else if(x>98837){printf("98849\n");return 0;}
else if(x>98809){printf("98837\n");return 0;}
else if(x>98807){printf("98809\n");return 0;}
else if(x>98801){printf("98807\n");return 0;}
else if(x>98779){printf("98801\n");return 0;}
else if(x>98773){printf("98779\n");return 0;}
else if(x>98737){printf("98773\n");return 0;}
else if(x>98731){printf("98737\n");return 0;}
else if(x>98729){printf("98731\n");return 0;}
else if(x>98717){printf("98729\n");return 0;}
else if(x>98713){printf("98717\n");return 0;}
else if(x>98711){printf("98713\n");return 0;}
else if(x>98689){printf("98711\n");return 0;}
else if(x>98669){printf("98689\n");return 0;}
else if(x>98663){printf("98669\n");return 0;}
else if(x>98641){printf("98663\n");return 0;}
else if(x>98639){printf("98641\n");return 0;}
else if(x>98627){printf("98639\n");return 0;}
else if(x>98621){printf("98627\n");return 0;}
else if(x>98597){printf("98621\n");return 0;}
else if(x>98573){printf("98597\n");return 0;}
else if(x>98563){printf("98573\n");return 0;}
else if(x>98561){printf("98563\n");return 0;}
else if(x>98543){printf("98561\n");return 0;}
else if(x>98533){printf("98543\n");return 0;}
else if(x>98519){printf("98533\n");return 0;}
else if(x>98507){printf("98519\n");return 0;}
else if(x>98491){printf("98507\n");return 0;}
else if(x>98479){printf("98491\n");return 0;}
else if(x>98473){printf("98479\n");return 0;}
else if(x>98467){printf("98473\n");return 0;}
else if(x>98459){printf("98467\n");return 0;}
else if(x>98453){printf("98459\n");return 0;}
else if(x>98443){printf("98453\n");return 0;}
else if(x>98429){printf("98443\n");return 0;}
else if(x>98419){printf("98429\n");return 0;}
else if(x>98411){printf("98419\n");return 0;}
else if(x>98407){printf("98411\n");return 0;}
else if(x>98389){printf("98407\n");return 0;}
else if(x>98387){printf("98389\n");return 0;}
else if(x>98377){printf("98387\n");return 0;}
else if(x>98369){printf("98377\n");return 0;}
else if(x>98347){printf("98369\n");return 0;}
else if(x>98327){printf("98347\n");return 0;}
else if(x>98323){printf("98327\n");return 0;}
else if(x>98321){printf("98323\n");return 0;}
else if(x>98317){printf("98321\n");return 0;}
else if(x>98299){printf("98317\n");return 0;}
else if(x>98297){printf("98299\n");return 0;}
else if(x>98269){printf("98297\n");return 0;}
else if(x>98257){printf("98269\n");return 0;}
else if(x>98251){printf("98257\n");return 0;}
else if(x>98227){printf("98251\n");return 0;}
else if(x>98221){printf("98227\n");return 0;}
else if(x>98213){printf("98221\n");return 0;}
else if(x>98207){printf("98213\n");return 0;}
else if(x>98179){printf("98207\n");return 0;}
else if(x>98143){printf("98179\n");return 0;}
else if(x>98129){printf("98143\n");return 0;}
else if(x>98123){printf("98129\n");return 0;}
else if(x>98101){printf("98123\n");return 0;}
else if(x>98081){printf("98101\n");return 0;}
else if(x>98057){printf("98081\n");return 0;}
else if(x>98047){printf("98057\n");return 0;}
else if(x>98041){printf("98047\n");return 0;}
else if(x>98017){printf("98041\n");return 0;}
else if(x>98011){printf("98017\n");return 0;}
else if(x>98009){printf("98011\n");return 0;}
else if(x>97987){printf("98009\n");return 0;}
else if(x>97973){printf("97987\n");return 0;}
else if(x>97967){printf("97973\n");return 0;}
else if(x>97961){printf("97967\n");return 0;}
else if(x>97943){printf("97961\n");return 0;}
else if(x>97931){printf("97943\n");return 0;}
else if(x>97927){printf("97931\n");return 0;}
else if(x>97919){printf("97927\n");return 0;}
else if(x>97883){printf("97919\n");return 0;}
else if(x>97879){printf("97883\n");return 0;}
else if(x>97871){printf("97879\n");return 0;}
else if(x>97861){printf("97871\n");return 0;}
else if(x>97859){printf("97861\n");return 0;}
else if(x>97849){printf("97859\n");return 0;}
else if(x>97847){printf("97849\n");return 0;}
else if(x>97843){printf("97847\n");return 0;}
else if(x>97841){printf("97843\n");return 0;}
else if(x>97829){printf("97841\n");return 0;}
else if(x>97813){printf("97829\n");return 0;}
else if(x>97789){printf("97813\n");return 0;}
else if(x>97787){printf("97789\n");return 0;}
else if(x>97777){printf("97787\n");return 0;}
else if(x>97771){printf("97777\n");return 0;}
else if(x>97729){printf("97771\n");return 0;}
else if(x>97711){printf("97729\n");return 0;}
else if(x>97687){printf("97711\n");return 0;}
else if(x>97673){printf("97687\n");return 0;}
else if(x>97651){printf("97673\n");return 0;}
else if(x>97649){printf("97651\n");return 0;}
else if(x>97613){printf("97649\n");return 0;}
else if(x>97609){printf("97613\n");return 0;}
else if(x>97607){printf("97609\n");return 0;}
else if(x>97583){printf("97607\n");return 0;}
else if(x>97579){printf("97583\n");return 0;}
else if(x>97577){printf("97579\n");return 0;}
else if(x>97571){printf("97577\n");return 0;}
else if(x>97561){printf("97571\n");return 0;}
else if(x>97553){printf("97561\n");return 0;}
else if(x>97549){printf("97553\n");return 0;}
else if(x>97547){printf("97549\n");return 0;}
else if(x>97523){printf("97547\n");return 0;}
else if(x>97511){printf("97523\n");return 0;}
else if(x>97501){printf("97511\n");return 0;}
else if(x>97499){printf("97501\n");return 0;}
else if(x>97463){printf("97499\n");return 0;}
else if(x>97459){printf("97463\n");return 0;}
else if(x>97453){printf("97459\n");return 0;}
else if(x>97441){printf("97453\n");return 0;}
else if(x>97429){printf("97441\n");return 0;}
else if(x>97423){printf("97429\n");return 0;}
else if(x>97397){printf("97423\n");return 0;}
else if(x>97387){printf("97397\n");return 0;}
else if(x>97381){printf("97387\n");return 0;}
else if(x>97379){printf("97381\n");return 0;}
else if(x>97373){printf("97379\n");return 0;}
else if(x>97369){printf("97373\n");return 0;}
else if(x>97367){printf("97369\n");return 0;}
else if(x>97327){printf("97367\n");return 0;}
else if(x>97303){printf("97327\n");return 0;}
else if(x>97301){printf("97303\n");return 0;}
else if(x>97283){printf("97301\n");return 0;}
else if(x>97259){printf("97283\n");return 0;}
else if(x>97241){printf("97259\n");return 0;}
else if(x>97231){printf("97241\n");return 0;}
else if(x>97213){printf("97231\n");return 0;}
else if(x>97187){printf("97213\n");return 0;}
else if(x>97177){printf("97187\n");return 0;}
else if(x>97171){printf("97177\n");return 0;}
else if(x>97169){printf("97171\n");return 0;}
else if(x>97159){printf("97169\n");return 0;}
else if(x>97157){printf("97159\n");return 0;}
else if(x>97151){printf("97157\n");return 0;}
else if(x>97127){printf("97151\n");return 0;}
else if(x>97117){printf("97127\n");return 0;}
else if(x>97103){printf("97117\n");return 0;}
else if(x>97081){printf("97103\n");return 0;}
else if(x>97073){printf("97081\n");return 0;}
else if(x>97039){printf("97073\n");return 0;}
else if(x>97021){printf("97039\n");return 0;}
else if(x>97007){printf("97021\n");return 0;}
else if(x>97003){printf("97007\n");return 0;}
else if(x>97001){printf("97003\n");return 0;}
else if(x>96997){printf("97001\n");return 0;}
else if(x>96989){printf("96997\n");return 0;}
else if(x>96979){printf("96989\n");return 0;}
else if(x>96973){printf("96979\n");return 0;}
else if(x>96959){printf("96973\n");return 0;}
else if(x>96953){printf("96959\n");return 0;}
else if(x>96931){printf("96953\n");return 0;}
else if(x>96911){printf("96931\n");return 0;}
else if(x>96907){printf("96911\n");return 0;}
else if(x>96893){printf("96907\n");return 0;}
else if(x>96857){printf("96893\n");return 0;}
else if(x>96851){printf("96857\n");return 0;}
else if(x>96847){printf("96851\n");return 0;}
else if(x>96827){printf("96847\n");return 0;}
else if(x>96823){printf("96827\n");return 0;}
else if(x>96821){printf("96823\n");return 0;}
else if(x>96799){printf("96821\n");return 0;}
else if(x>96797){printf("96799\n");return 0;}
else if(x>96787){printf("96797\n");return 0;}
else if(x>96779){printf("96787\n");return 0;}
else if(x>96769){printf("96779\n");return 0;}
else if(x>96763){printf("96769\n");return 0;}
else if(x>96757){printf("96763\n");return 0;}
else if(x>96749){printf("96757\n");return 0;}
else if(x>96739){printf("96749\n");return 0;}
else if(x>96737){printf("96739\n");return 0;}
else if(x>96731){printf("96737\n");return 0;}
else if(x>96703){printf("96731\n");return 0;}
else if(x>96697){printf("96703\n");return 0;}
else if(x>96671){printf("96697\n");return 0;}
else if(x>96667){printf("96671\n");return 0;}
else if(x>96661){printf("96667\n");return 0;}
else if(x>96643){printf("96661\n");return 0;}
else if(x>96601){printf("96643\n");return 0;}
else if(x>96589){printf("96601\n");return 0;}
else if(x>96587){printf("96589\n");return 0;}
else if(x>96581){printf("96587\n");return 0;}
else if(x>96557){printf("96581\n");return 0;}
else if(x>96553){printf("96557\n");return 0;}
else if(x>96527){printf("96553\n");return 0;}
else if(x>96517){printf("96527\n");return 0;}
else if(x>96497){printf("96517\n");return 0;}
else if(x>96493){printf("96497\n");return 0;}
else if(x>96487){printf("96493\n");return 0;}
else if(x>96479){printf("96487\n");return 0;}
else if(x>96469){printf("96479\n");return 0;}
else if(x>96461){printf("96469\n");return 0;}
else if(x>96457){printf("96461\n");return 0;}
else if(x>96451){printf("96457\n");return 0;}
else if(x>96443){printf("96451\n");return 0;}
else if(x>96431){printf("96443\n");return 0;}
else if(x>96419){printf("96431\n");return 0;}
else if(x>96401){printf("96419\n");return 0;}
else if(x>96377){printf("96401\n");return 0;}
else if(x>96353){printf("96377\n");return 0;}
else if(x>96337){printf("96353\n");return 0;}
else if(x>96331){printf("96337\n");return 0;}
else if(x>96329){printf("96331\n");return 0;}
else if(x>96323){printf("96329\n");return 0;}
else if(x>96293){printf("96323\n");return 0;}
else if(x>96289){printf("96293\n");return 0;}
else if(x>96281){printf("96289\n");return 0;}
else if(x>96269){printf("96281\n");return 0;}
else if(x>96263){printf("96269\n");return 0;}
else if(x>96259){printf("96263\n");return 0;}
else if(x>96233){printf("96259\n");return 0;}
else if(x>96223){printf("96233\n");return 0;}
else if(x>96221){printf("96223\n");return 0;}
else if(x>96211){printf("96221\n");return 0;}
else if(x>96199){printf("96211\n");return 0;}
else if(x>96181){printf("96199\n");return 0;}
else if(x>96179){printf("96181\n");return 0;}
else if(x>96167){printf("96179\n");return 0;}
else if(x>96157){printf("96167\n");return 0;}
else if(x>96149){printf("96157\n");return 0;}
else if(x>96137){printf("96149\n");return 0;}
else if(x>96097){printf("96137\n");return 0;}
else if(x>96079){printf("96097\n");return 0;}
else if(x>96059){printf("96079\n");return 0;}
else if(x>96053){printf("96059\n");return 0;}
else if(x>96043){printf("96053\n");return 0;}
else if(x>96017){printf("96043\n");return 0;}
else if(x>96013){printf("96017\n");return 0;}
else if(x>96001){printf("96013\n");return 0;}
else if(x>95989){printf("96001\n");return 0;}
else if(x>95987){printf("95989\n");return 0;}
else if(x>95971){printf("95987\n");return 0;}
else if(x>95959){printf("95971\n");return 0;}
else if(x>95957){printf("95959\n");return 0;}
else if(x>95947){printf("95957\n");return 0;}
else if(x>95929){printf("95947\n");return 0;}
else if(x>95923){printf("95929\n");return 0;}
else if(x>95917){printf("95923\n");return 0;}
else if(x>95911){printf("95917\n");return 0;}
else if(x>95891){printf("95911\n");return 0;}
else if(x>95881){printf("95891\n");return 0;}
else if(x>95873){printf("95881\n");return 0;}
else if(x>95869){printf("95873\n");return 0;}
else if(x>95857){printf("95869\n");return 0;}
else if(x>95819){printf("95857\n");return 0;}
else if(x>95813){printf("95819\n");return 0;}
else if(x>95803){printf("95813\n");return 0;}
else if(x>95801){printf("95803\n");return 0;}
else if(x>95791){printf("95801\n");return 0;}
else if(x>95789){printf("95791\n");return 0;}
else if(x>95783){printf("95789\n");return 0;}
else if(x>95773){printf("95783\n");return 0;}
else if(x>95747){printf("95773\n");return 0;}
else if(x>95737){printf("95747\n");return 0;}
else if(x>95731){printf("95737\n");return 0;}
else if(x>95723){printf("95731\n");return 0;}
else if(x>95717){printf("95723\n");return 0;}
else if(x>95713){printf("95717\n");return 0;}
else if(x>95707){printf("95713\n");return 0;}
else if(x>95701){printf("95707\n");return 0;}
else if(x>95651){printf("95701\n");return 0;}
else if(x>95633){printf("95651\n");return 0;}
else if(x>95629){printf("95633\n");return 0;}
else if(x>95621){printf("95629\n");return 0;}
else if(x>95617){printf("95621\n");return 0;}
else if(x>95603){printf("95617\n");return 0;}
else if(x>95597){printf("95603\n");return 0;}
else if(x>95581){printf("95597\n");return 0;}
else if(x>95569){printf("95581\n");return 0;}
else if(x>95561){printf("95569\n");return 0;}
else if(x>95549){printf("95561\n");return 0;}
else if(x>95539){printf("95549\n");return 0;}
else if(x>95531){printf("95539\n");return 0;}
else if(x>95527){printf("95531\n");return 0;}
else if(x>95507){printf("95527\n");return 0;}
else if(x>95483){printf("95507\n");return 0;}
else if(x>95479){printf("95483\n");return 0;}
else if(x>95471){printf("95479\n");return 0;}
else if(x>95467){printf("95471\n");return 0;}
else if(x>95461){printf("95467\n");return 0;}
else if(x>95443){printf("95461\n");return 0;}
else if(x>95441){printf("95443\n");return 0;}
else if(x>95429){printf("95441\n");return 0;}
else if(x>95419){printf("95429\n");return 0;}
else if(x>95413){printf("95419\n");return 0;}
else if(x>95401){printf("95413\n");return 0;}
else if(x>95393){printf("95401\n");return 0;}
else if(x>95383){printf("95393\n");return 0;}
else if(x>95369){printf("95383\n");return 0;}
else if(x>95339){printf("95369\n");return 0;}
else if(x>95327){printf("95339\n");return 0;}
else if(x>95317){printf("95327\n");return 0;}
else if(x>95311){printf("95317\n");return 0;}
else if(x>95287){printf("95311\n");return 0;}
else if(x>95279){printf("95287\n");return 0;}
else if(x>95273){printf("95279\n");return 0;}
else if(x>95267){printf("95273\n");return 0;}
else if(x>95261){printf("95267\n");return 0;}
else if(x>95257){printf("95261\n");return 0;}
else if(x>95239){printf("95257\n");return 0;}
else if(x>95233){printf("95239\n");return 0;}
else if(x>95231){printf("95233\n");return 0;}
else if(x>95219){printf("95231\n");return 0;}
else if(x>95213){printf("95219\n");return 0;}
else if(x>95203){printf("95213\n");return 0;}
else if(x>95191){printf("95203\n");return 0;}
else if(x>95189){printf("95191\n");return 0;}
else if(x>95177){printf("95189\n");return 0;}
else if(x>95153){printf("95177\n");return 0;}
else if(x>95143){printf("95153\n");return 0;}
else if(x>95131){printf("95143\n");return 0;}
else if(x>95111){printf("95131\n");return 0;}
else if(x>95107){printf("95111\n");return 0;}
else if(x>95101){printf("95107\n");return 0;}
else if(x>95093){printf("95101\n");return 0;}
else if(x>95089){printf("95093\n");return 0;}
else if(x>95087){printf("95089\n");return 0;}
else if(x>95083){printf("95087\n");return 0;}
else if(x>95071){printf("95083\n");return 0;}
else if(x>95063){printf("95071\n");return 0;}
else if(x>95027){printf("95063\n");return 0;}
else if(x>95021){printf("95027\n");return 0;}
else if(x>95009){printf("95021\n");return 0;}
else if(x>95003){printf("95009\n");return 0;}
else if(x>94999){printf("95003\n");return 0;}
else if(x>94993){printf("94999\n");return 0;}
else if(x>94961){printf("94993\n");return 0;}
else if(x>94951){printf("94961\n");return 0;}
else if(x>94949){printf("94951\n");return 0;}
else if(x>94933){printf("94949\n");return 0;}
else if(x>94907){printf("94933\n");return 0;}
else if(x>94903){printf("94907\n");return 0;}
else if(x>94889){printf("94903\n");return 0;}
else if(x>94873){printf("94889\n");return 0;}
else if(x>94849){printf("94873\n");return 0;}
else if(x>94847){printf("94849\n");return 0;}
else if(x>94841){printf("94847\n");return 0;}
else if(x>94837){printf("94841\n");return 0;}
else if(x>94823){printf("94837\n");return 0;}
else if(x>94819){printf("94823\n");return 0;}
else if(x>94811){printf("94819\n");return 0;}
else if(x>94793){printf("94811\n");return 0;}
else if(x>94789){printf("94793\n");return 0;}
else if(x>94781){printf("94789\n");return 0;}
else if(x>94777){printf("94781\n");return 0;}
else if(x>94771){printf("94777\n");return 0;}
else if(x>94747){printf("94771\n");return 0;}
else if(x>94727){printf("94747\n");return 0;}
else if(x>94723){printf("94727\n");return 0;}
else if(x>94709){printf("94723\n");return 0;}
else if(x>94693){printf("94709\n");return 0;}
else if(x>94687){printf("94693\n");return 0;}
else if(x>94651){printf("94687\n");return 0;}
else if(x>94649){printf("94651\n");return 0;}
else if(x>94621){printf("94649\n");return 0;}
else if(x>94613){printf("94621\n");return 0;}
else if(x>94603){printf("94613\n");return 0;}
else if(x>94597){printf("94603\n");return 0;}
else if(x>94583){printf("94597\n");return 0;}
else if(x>94573){printf("94583\n");return 0;}
else if(x>94561){printf("94573\n");return 0;}
else if(x>94559){printf("94561\n");return 0;}
else if(x>94547){printf("94559\n");return 0;}
else if(x>94543){printf("94547\n");return 0;}
else if(x>94541){printf("94543\n");return 0;}
else if(x>94531){printf("94541\n");return 0;}
else if(x>94529){printf("94531\n");return 0;}
else if(x>94513){printf("94529\n");return 0;}
else if(x>94483){printf("94513\n");return 0;}
else if(x>94477){printf("94483\n");return 0;}
else if(x>94463){printf("94477\n");return 0;}
else if(x>94447){printf("94463\n");return 0;}
else if(x>94441){printf("94447\n");return 0;}
else if(x>94439){printf("94441\n");return 0;}
else if(x>94433){printf("94439\n");return 0;}
else if(x>94427){printf("94433\n");return 0;}
else if(x>94421){printf("94427\n");return 0;}
else if(x>94399){printf("94421\n");return 0;}
else if(x>94397){printf("94399\n");return 0;}
else if(x>94379){printf("94397\n");return 0;}
else if(x>94351){printf("94379\n");return 0;}
else if(x>94349){printf("94351\n");return 0;}
else if(x>94343){printf("94349\n");return 0;}
else if(x>94331){printf("94343\n");return 0;}
else if(x>94327){printf("94331\n");return 0;}
else if(x>94321){printf("94327\n");return 0;}
else if(x>94309){printf("94321\n");return 0;}
else if(x>94307){printf("94309\n");return 0;}
else if(x>94291){printf("94307\n");return 0;}
else if(x>94273){printf("94291\n");return 0;}
else if(x>94261){printf("94273\n");return 0;}
else if(x>94253){printf("94261\n");return 0;}
else if(x>94229){printf("94253\n");return 0;}
else if(x>94219){printf("94229\n");return 0;}
else if(x>94207){printf("94219\n");return 0;}
else if(x>94201){printf("94207\n");return 0;}
else if(x>94169){printf("94201\n");return 0;}
else if(x>94153){printf("94169\n");return 0;}
else if(x>94151){printf("94153\n");return 0;}
else if(x>94121){printf("94151\n");return 0;}
else if(x>94117){printf("94121\n");return 0;}
else if(x>94111){printf("94117\n");return 0;}
else if(x>94109){printf("94111\n");return 0;}
else if(x>94099){printf("94109\n");return 0;}
else if(x>94079){printf("94099\n");return 0;}
else if(x>94063){printf("94079\n");return 0;}
else if(x>94057){printf("94063\n");return 0;}
else if(x>94049){printf("94057\n");return 0;}
else if(x>94033){printf("94049\n");return 0;}
else if(x>94009){printf("94033\n");return 0;}
else if(x>94007){printf("94009\n");return 0;}
else if(x>93997){printf("94007\n");return 0;}
else if(x>93983){printf("93997\n");return 0;}
else if(x>93979){printf("93983\n");return 0;}
else if(x>93971){printf("93979\n");return 0;}
else if(x>93967){printf("93971\n");return 0;}
else if(x>93949){printf("93967\n");return 0;}
else if(x>93941){printf("93949\n");return 0;}
else if(x>93937){printf("93941\n");return 0;}
else if(x>93923){printf("93937\n");return 0;}
else if(x>93913){printf("93923\n");return 0;}
else if(x>93911){printf("93913\n");return 0;}
else if(x>93901){printf("93911\n");return 0;}
else if(x>93893){printf("93901\n");return 0;}
else if(x>93889){printf("93893\n");return 0;}
else if(x>93887){printf("93889\n");return 0;}
else if(x>93871){printf("93887\n");return 0;}
else if(x>93851){printf("93871\n");return 0;}
else if(x>93827){printf("93851\n");return 0;}
else if(x>93811){printf("93827\n");return 0;}
else if(x>93809){printf("93811\n");return 0;}
else if(x>93787){printf("93809\n");return 0;}
else if(x>93763){printf("93787\n");return 0;}
else if(x>93761){printf("93763\n");return 0;}
else if(x>93739){printf("93761\n");return 0;}
else if(x>93719){printf("93739\n");return 0;}
else if(x>93703){printf("93719\n");return 0;}
else if(x>93701){printf("93703\n");return 0;}
else if(x>93683){printf("93701\n");return 0;}
else if(x>93637){printf("93683\n");return 0;}
else if(x>93629){printf("93637\n");return 0;}
else if(x>93607){printf("93629\n");return 0;}
else if(x>93601){printf("93607\n");return 0;}
else if(x>93581){printf("93601\n");return 0;}
else if(x>93563){printf("93581\n");return 0;}
else if(x>93559){printf("93563\n");return 0;}
else if(x>93557){printf("93559\n");return 0;}
else if(x>93553){printf("93557\n");return 0;}
else if(x>93529){printf("93553\n");return 0;}
else if(x>93523){printf("93529\n");return 0;}
else if(x>93503){printf("93523\n");return 0;}
else if(x>93497){printf("93503\n");return 0;}
else if(x>93493){printf("93497\n");return 0;}
else if(x>93491){printf("93493\n");return 0;}
else if(x>93487){printf("93491\n");return 0;}
else if(x>93481){printf("93487\n");return 0;}
else if(x>93479){printf("93481\n");return 0;}
else if(x>93463){printf("93479\n");return 0;}
else if(x>93427){printf("93463\n");return 0;}
else if(x>93419){printf("93427\n");return 0;}
else if(x>93407){printf("93419\n");return 0;}
else if(x>93383){printf("93407\n");return 0;}
else if(x>93377){printf("93383\n");return 0;}
else if(x>93371){printf("93377\n");return 0;}
else if(x>93337){printf("93371\n");return 0;}
else if(x>93329){printf("93337\n");return 0;}
else if(x>93323){printf("93329\n");return 0;}
else if(x>93319){printf("93323\n");return 0;}
else if(x>93307){printf("93319\n");return 0;}
else if(x>93287){printf("93307\n");return 0;}
else if(x>93283){printf("93287\n");return 0;}
else if(x>93281){printf("93283\n");return 0;}
else if(x>93263){printf("93281\n");return 0;}
else if(x>93257){printf("93263\n");return 0;}
else if(x>93253){printf("93257\n");return 0;}
else if(x>93251){printf("93253\n");return 0;}
else if(x>93241){printf("93251\n");return 0;}
else if(x>93239){printf("93241\n");return 0;}
else if(x>93229){printf("93239\n");return 0;}
else if(x>93199){printf("93229\n");return 0;}
else if(x>93187){printf("93199\n");return 0;}
else if(x>93179){printf("93187\n");return 0;}
else if(x>93169){printf("93179\n");return 0;}
else if(x>93151){printf("93169\n");return 0;}
else if(x>93139){printf("93151\n");return 0;}
else if(x>93133){printf("93139\n");return 0;}
else if(x>93131){printf("93133\n");return 0;}
else if(x>93113){printf("93131\n");return 0;}
else if(x>93103){printf("93113\n");return 0;}
else if(x>93097){printf("93103\n");return 0;}
else if(x>93089){printf("93097\n");return 0;}
else if(x>93083){printf("93089\n");return 0;}
else if(x>93077){printf("93083\n");return 0;}
else if(x>93059){printf("93077\n");return 0;}
else if(x>93053){printf("93059\n");return 0;}
else if(x>93047){printf("93053\n");return 0;}
else if(x>93001){printf("93047\n");return 0;}
else if(x>92993){printf("93001\n");return 0;}
else if(x>92987){printf("92993\n");return 0;}
else if(x>92959){printf("92987\n");return 0;}
else if(x>92957){printf("92959\n");return 0;}
else if(x>92951){printf("92957\n");return 0;}
else if(x>92941){printf("92951\n");return 0;}
else if(x>92927){printf("92941\n");return 0;}
else if(x>92921){printf("92927\n");return 0;}
else if(x>92899){printf("92921\n");return 0;}
else if(x>92893){printf("92899\n");return 0;}
else if(x>92867){printf("92893\n");return 0;}
else if(x>92863){printf("92867\n");return 0;}
else if(x>92861){printf("92863\n");return 0;}
else if(x>92857){printf("92861\n");return 0;}
else if(x>92849){printf("92857\n");return 0;}
else if(x>92831){printf("92849\n");return 0;}
else if(x>92821){printf("92831\n");return 0;}
else if(x>92809){printf("92821\n");return 0;}
else if(x>92801){printf("92809\n");return 0;}
else if(x>92791){printf("92801\n");return 0;}
else if(x>92789){printf("92791\n");return 0;}
else if(x>92779){printf("92789\n");return 0;}
else if(x>92767){printf("92779\n");return 0;}
else if(x>92761){printf("92767\n");return 0;}
else if(x>92753){printf("92761\n");return 0;}
else if(x>92737){printf("92753\n");return 0;}
else if(x>92723){printf("92737\n");return 0;}
else if(x>92717){printf("92723\n");return 0;}
else if(x>92707){printf("92717\n");return 0;}
else if(x>92699){printf("92707\n");return 0;}
else if(x>92693){printf("92699\n");return 0;}
else if(x>92683){printf("92693\n");return 0;}
else if(x>92681){printf("92683\n");return 0;}
else if(x>92671){printf("92681\n");return 0;}
else if(x>92669){printf("92671\n");return 0;}
else if(x>92657){printf("92669\n");return 0;}
else if(x>92647){printf("92657\n");return 0;}
else if(x>92641){printf("92647\n");return 0;}
else if(x>92639){printf("92641\n");return 0;}
else if(x>92627){printf("92639\n");return 0;}
else if(x>92623){printf("92627\n");return 0;}
else if(x>92593){printf("92623\n");return 0;}
else if(x>92581){printf("92593\n");return 0;}
else if(x>92569){printf("92581\n");return 0;}
else if(x>92567){printf("92569\n");return 0;}
else if(x>92557){printf("92567\n");return 0;}
else if(x>92551){printf("92557\n");return 0;}
else if(x>92507){printf("92551\n");return 0;}
else if(x>92503){printf("92507\n");return 0;}
else if(x>92489){printf("92503\n");return 0;}
else if(x>92479){printf("92489\n");return 0;}
else if(x>92467){printf("92479\n");return 0;}
else if(x>92461){printf("92467\n");return 0;}
else if(x>92459){printf("92461\n");return 0;}
else if(x>92431){printf("92459\n");return 0;}
else if(x>92419){printf("92431\n");return 0;}
else if(x>92413){printf("92419\n");return 0;}
else if(x>92401){printf("92413\n");return 0;}
else if(x>92399){printf("92401\n");return 0;}
else if(x>92387){printf("92399\n");return 0;}
else if(x>92383){printf("92387\n");return 0;}
else if(x>92381){printf("92383\n");return 0;}
else if(x>92377){printf("92381\n");return 0;}
else if(x>92369){printf("92377\n");return 0;}
else if(x>92363){printf("92369\n");return 0;}
else if(x>92357){printf("92363\n");return 0;}
else if(x>92353){printf("92357\n");return 0;}
else if(x>92347){printf("92353\n");return 0;}
else if(x>92333){printf("92347\n");return 0;}
else if(x>92317){printf("92333\n");return 0;}
else if(x>92311){printf("92317\n");return 0;}
else if(x>92297){printf("92311\n");return 0;}
else if(x>92269){printf("92297\n");return 0;}
else if(x>92251){printf("92269\n");return 0;}
else if(x>92243){printf("92251\n");return 0;}
else if(x>92237){printf("92243\n");return 0;}
else if(x>92233){printf("92237\n");return 0;}
else if(x>92227){printf("92233\n");return 0;}
else if(x>92221){printf("92227\n");return 0;}
else if(x>92219){printf("92221\n");return 0;}
else if(x>92203){printf("92219\n");return 0;}
else if(x>92189){printf("92203\n");return 0;}
else if(x>92179){printf("92189\n");return 0;}
else if(x>92177){printf("92179\n");return 0;}
else if(x>92173){printf("92177\n");return 0;}
else if(x>92153){printf("92173\n");return 0;}
else if(x>92143){printf("92153\n");return 0;}
else if(x>92119){printf("92143\n");return 0;}
else if(x>92111){printf("92119\n");return 0;}
else if(x>92107){printf("92111\n");return 0;}
else if(x>92083){printf("92107\n");return 0;}
else if(x>92077){printf("92083\n");return 0;}
else if(x>92051){printf("92077\n");return 0;}
else if(x>92041){printf("92051\n");return 0;}
else if(x>92033){printf("92041\n");return 0;}
else if(x>92009){printf("92033\n");return 0;}
else if(x>92003){printf("92009\n");return 0;}
else if(x>91997){printf("92003\n");return 0;}
else if(x>91969){printf("91997\n");return 0;}
else if(x>91967){printf("91969\n");return 0;}
else if(x>91961){printf("91967\n");return 0;}
else if(x>91957){printf("91961\n");return 0;}
else if(x>91951){printf("91957\n");return 0;}
else if(x>91943){printf("91951\n");return 0;}
else if(x>91939){printf("91943\n");return 0;}
else if(x>91921){printf("91939\n");return 0;}
else if(x>91909){printf("91921\n");return 0;}
else if(x>91873){printf("91909\n");return 0;}
else if(x>91867){printf("91873\n");return 0;}
else if(x>91841){printf("91867\n");return 0;}
else if(x>91837){printf("91841\n");return 0;}
else if(x>91823){printf("91837\n");return 0;}
else if(x>91813){printf("91823\n");return 0;}
else if(x>91811){printf("91813\n");return 0;}
else if(x>91807){printf("91811\n");return 0;}
else if(x>91801){printf("91807\n");return 0;}
else if(x>91781){printf("91801\n");return 0;}
else if(x>91771){printf("91781\n");return 0;}
else if(x>91757){printf("91771\n");return 0;}
else if(x>91753){printf("91757\n");return 0;}
else if(x>91733){printf("91753\n");return 0;}
else if(x>91711){printf("91733\n");return 0;}
else if(x>91703){printf("91711\n");return 0;}
else if(x>91691){printf("91703\n");return 0;}
else if(x>91673){printf("91691\n");return 0;}
else if(x>91639){printf("91673\n");return 0;}
else if(x>91631){printf("91639\n");return 0;}
else if(x>91621){printf("91631\n");return 0;}
else if(x>91591){printf("91621\n");return 0;}
else if(x>91583){printf("91591\n");return 0;}
else if(x>91577){printf("91583\n");return 0;}
else if(x>91573){printf("91577\n");return 0;}
else if(x>91571){printf("91573\n");return 0;}
else if(x>91541){printf("91571\n");return 0;}
else if(x>91529){printf("91541\n");return 0;}
else if(x>91513){printf("91529\n");return 0;}
else if(x>91499){printf("91513\n");return 0;}
else if(x>91493){printf("91499\n");return 0;}
else if(x>91463){printf("91493\n");return 0;}
else if(x>91459){printf("91463\n");return 0;}
else if(x>91457){printf("91459\n");return 0;}
else if(x>91453){printf("91457\n");return 0;}
else if(x>91433){printf("91453\n");return 0;}
else if(x>91423){printf("91433\n");return 0;}
else if(x>91411){printf("91423\n");return 0;}
else if(x>91397){printf("91411\n");return 0;}
else if(x>91393){printf("91397\n");return 0;}
else if(x>91387){printf("91393\n");return 0;}
else if(x>91381){printf("91387\n");return 0;}
else if(x>91373){printf("91381\n");return 0;}
else if(x>91369){printf("91373\n");return 0;}
else if(x>91367){printf("91369\n");return 0;}
else if(x>91331){printf("91367\n");return 0;}
else if(x>91309){printf("91331\n");return 0;}
else if(x>91303){printf("91309\n");return 0;}
else if(x>91297){printf("91303\n");return 0;}
else if(x>91291){printf("91297\n");return 0;}
else if(x>91283){printf("91291\n");return 0;}
else if(x>91253){printf("91283\n");return 0;}
else if(x>91249){printf("91253\n");return 0;}
else if(x>91243){printf("91249\n");return 0;}
else if(x>91237){printf("91243\n");return 0;}
else if(x>91229){printf("91237\n");return 0;}
else if(x>91199){printf("91229\n");return 0;}
else if(x>91193){printf("91199\n");return 0;}
else if(x>91183){printf("91193\n");return 0;}
else if(x>91163){printf("91183\n");return 0;}
else if(x>91159){printf("91163\n");return 0;}
else if(x>91153){printf("91159\n");return 0;}
else if(x>91151){printf("91153\n");return 0;}
else if(x>91141){printf("91151\n");return 0;}
else if(x>91139){printf("91141\n");return 0;}
else if(x>91129){printf("91139\n");return 0;}
else if(x>91127){printf("91129\n");return 0;}
else if(x>91121){printf("91127\n");return 0;}
else if(x>91099){printf("91121\n");return 0;}
else if(x>91097){printf("91099\n");return 0;}
else if(x>91081){printf("91097\n");return 0;}
else if(x>91079){printf("91081\n");return 0;}
else if(x>91033){printf("91079\n");return 0;}
else if(x>91019){printf("91033\n");return 0;}
else if(x>91009){printf("91019\n");return 0;}
else if(x>90997){printf("91009\n");return 0;}
else if(x>90989){printf("90997\n");return 0;}
else if(x>90977){printf("90989\n");return 0;}
else if(x>90971){printf("90977\n");return 0;}
else if(x>90947){printf("90971\n");return 0;}
else if(x>90931){printf("90947\n");return 0;}
else if(x>90917){printf("90931\n");return 0;}
else if(x>90911){printf("90917\n");return 0;}
else if(x>90907){printf("90911\n");return 0;}
else if(x>90901){printf("90907\n");return 0;}
else if(x>90887){printf("90901\n");return 0;}
else if(x>90863){printf("90887\n");return 0;}
else if(x>90847){printf("90863\n");return 0;}
else if(x>90841){printf("90847\n");return 0;}
else if(x>90833){printf("90841\n");return 0;}
else if(x>90823){printf("90833\n");return 0;}
else if(x>90821){printf("90823\n");return 0;}
else if(x>90803){printf("90821\n");return 0;}
else if(x>90793){printf("90803\n");return 0;}
else if(x>90787){printf("90793\n");return 0;}
else if(x>90749){printf("90787\n");return 0;}
else if(x>90731){printf("90749\n");return 0;}
else if(x>90709){printf("90731\n");return 0;}
else if(x>90703){printf("90709\n");return 0;}
else if(x>90697){printf("90703\n");return 0;}
else if(x>90679){printf("90697\n");return 0;}
else if(x>90677){printf("90679\n");return 0;}
else if(x>90659){printf("90677\n");return 0;}
else if(x>90647){printf("90659\n");return 0;}
else if(x>90641){printf("90647\n");return 0;}
else if(x>90631){printf("90641\n");return 0;}
else if(x>90619){printf("90631\n");return 0;}
else if(x>90617){printf("90619\n");return 0;}
else if(x>90599){printf("90617\n");return 0;}
else if(x>90583){printf("90599\n");return 0;}
else if(x>90547){printf("90583\n");return 0;}
else if(x>90533){printf("90547\n");return 0;}
else if(x>90529){printf("90533\n");return 0;}
else if(x>90527){printf("90529\n");return 0;}
else if(x>90523){printf("90527\n");return 0;}
else if(x>90511){printf("90523\n");return 0;}
else if(x>90499){printf("90511\n");return 0;}
else if(x>90481){printf("90499\n");return 0;}
else if(x>90473){printf("90481\n");return 0;}
else if(x>90469){printf("90473\n");return 0;}
else if(x>90439){printf("90469\n");return 0;}
else if(x>90437){printf("90439\n");return 0;}
else if(x>90407){printf("90437\n");return 0;}
else if(x>90403){printf("90407\n");return 0;}
else if(x>90401){printf("90403\n");return 0;}
else if(x>90397){printf("90401\n");return 0;}
else if(x>90379){printf("90397\n");return 0;}
else if(x>90373){printf("90379\n");return 0;}
else if(x>90371){printf("90373\n");return 0;}
else if(x>90359){printf("90371\n");return 0;}
else if(x>90353){printf("90359\n");return 0;}
else if(x>90313){printf("90353\n");return 0;}
else if(x>90289){printf("90313\n");return 0;}
else if(x>90281){printf("90289\n");return 0;}
else if(x>90271){printf("90281\n");return 0;}
else if(x>90263){printf("90271\n");return 0;}
else if(x>90247){printf("90263\n");return 0;}
else if(x>90239){printf("90247\n");return 0;}
else if(x>90227){printf("90239\n");return 0;}
else if(x>90217){printf("90227\n");return 0;}
else if(x>90203){printf("90217\n");return 0;}
else if(x>90199){printf("90203\n");return 0;}
else if(x>90197){printf("90199\n");return 0;}
else if(x>90191){printf("90197\n");return 0;}
else if(x>90187){printf("90191\n");return 0;}
else if(x>90173){printf("90187\n");return 0;}
else if(x>90163){printf("90173\n");return 0;}
else if(x>90149){printf("90163\n");return 0;}
else if(x>90127){printf("90149\n");return 0;}
else if(x>90121){printf("90127\n");return 0;}
else if(x>90107){printf("90121\n");return 0;}
else if(x>90089){printf("90107\n");return 0;}
else if(x>90073){printf("90089\n");return 0;}
else if(x>90071){printf("90073\n");return 0;}
else if(x>90067){printf("90071\n");return 0;}
else if(x>90059){printf("90067\n");return 0;}
else if(x>90053){printf("90059\n");return 0;}
else if(x>90031){printf("90053\n");return 0;}
else if(x>90023){printf("90031\n");return 0;}
else if(x>90019){printf("90023\n");return 0;}
else if(x>90017){printf("90019\n");return 0;}
else if(x>90011){printf("90017\n");return 0;}
else if(x>90007){printf("90011\n");return 0;}
else if(x>90001){printf("90007\n");return 0;}
else if(x>89989){printf("90001\n");return 0;}
else if(x>89983){printf("89989\n");return 0;}
else if(x>89977){printf("89983\n");return 0;}
else if(x>89963){printf("89977\n");return 0;}
else if(x>89959){printf("89963\n");return 0;}
else if(x>89939){printf("89959\n");return 0;}
else if(x>89923){printf("89939\n");return 0;}
else if(x>89917){printf("89923\n");return 0;}
else if(x>89909){printf("89917\n");return 0;}
else if(x>89899){printf("89909\n");return 0;}
else if(x>89897){printf("89899\n");return 0;}
else if(x>89891){printf("89897\n");return 0;}
else if(x>89867){printf("89891\n");return 0;}
else if(x>89849){printf("89867\n");return 0;}
else if(x>89839){printf("89849\n");return 0;}
else if(x>89833){printf("89839\n");return 0;}
else if(x>89821){printf("89833\n");return 0;}
else if(x>89819){printf("89821\n");return 0;}
else if(x>89809){printf("89819\n");return 0;}
else if(x>89797){printf("89809\n");return 0;}
else if(x>89783){printf("89797\n");return 0;}
else if(x>89779){printf("89783\n");return 0;}
else if(x>89767){printf("89779\n");return 0;}
else if(x>89759){printf("89767\n");return 0;}
else if(x>89753){printf("89759\n");return 0;}
else if(x>89689){printf("89753\n");return 0;}
else if(x>89681){printf("89689\n");return 0;}
else if(x>89671){printf("89681\n");return 0;}
else if(x>89669){printf("89671\n");return 0;}
else if(x>89659){printf("89669\n");return 0;}
else if(x>89657){printf("89659\n");return 0;}
else if(x>89653){printf("89657\n");return 0;}
else if(x>89633){printf("89653\n");return 0;}
else if(x>89627){printf("89633\n");return 0;}
else if(x>89611){printf("89627\n");return 0;}
else if(x>89603){printf("89611\n");return 0;}
else if(x>89599){printf("89603\n");return 0;}
else if(x>89597){printf("89599\n");return 0;}
else if(x>89591){printf("89597\n");return 0;}
else if(x>89567){printf("89591\n");return 0;}
else if(x>89563){printf("89567\n");return 0;}
else if(x>89561){printf("89563\n");return 0;}
else if(x>89533){printf("89561\n");return 0;}
else if(x>89527){printf("89533\n");return 0;}
else if(x>89521){printf("89527\n");return 0;}
else if(x>89519){printf("89521\n");return 0;}
else if(x>89513){printf("89519\n");return 0;}
else if(x>89501){printf("89513\n");return 0;}
else if(x>89491){printf("89501\n");return 0;}
else if(x>89477){printf("89491\n");return 0;}
else if(x>89459){printf("89477\n");return 0;}
else if(x>89449){printf("89459\n");return 0;}
else if(x>89443){printf("89449\n");return 0;}
else if(x>89431){printf("89443\n");return 0;}
else if(x>89417){printf("89431\n");return 0;}
else if(x>89413){printf("89417\n");return 0;}
else if(x>89399){printf("89413\n");return 0;}
else if(x>89393){printf("89399\n");return 0;}
else if(x>89387){printf("89393\n");return 0;}
else if(x>89381){printf("89387\n");return 0;}
else if(x>89371){printf("89381\n");return 0;}
else if(x>89363){printf("89371\n");return 0;}
else if(x>89329){printf("89363\n");return 0;}
else if(x>89317){printf("89329\n");return 0;}
else if(x>89303){printf("89317\n");return 0;}
else if(x>89293){printf("89303\n");return 0;}
else if(x>89273){printf("89293\n");return 0;}
else if(x>89269){printf("89273\n");return 0;}
else if(x>89261){printf("89269\n");return 0;}
else if(x>89237){printf("89261\n");return 0;}
else if(x>89231){printf("89237\n");return 0;}
else if(x>89227){printf("89231\n");return 0;}
else if(x>89213){printf("89227\n");return 0;}
else if(x>89209){printf("89213\n");return 0;}
else if(x>89203){printf("89209\n");return 0;}
else if(x>89189){printf("89203\n");return 0;}
else if(x>89153){printf("89189\n");return 0;}
else if(x>89137){printf("89153\n");return 0;}
else if(x>89123){printf("89137\n");return 0;}
else if(x>89119){printf("89123\n");return 0;}
else if(x>89113){printf("89119\n");return 0;}
else if(x>89107){printf("89113\n");return 0;}
else if(x>89101){printf("89107\n");return 0;}
else if(x>89087){printf("89101\n");return 0;}
else if(x>89083){printf("89087\n");return 0;}
else if(x>89071){printf("89083\n");return 0;}
else if(x>89069){printf("89071\n");return 0;}
else if(x>89057){printf("89069\n");return 0;}
else if(x>89051){printf("89057\n");return 0;}
else if(x>89041){printf("89051\n");return 0;}
else if(x>89021){printf("89041\n");return 0;}
else if(x>89017){printf("89021\n");return 0;}
else if(x>89009){printf("89017\n");return 0;}
else if(x>89003){printf("89009\n");return 0;}
else if(x>88997){printf("89003\n");return 0;}
else if(x>88993){printf("88997\n");return 0;}
else if(x>88969){printf("88993\n");return 0;}
else if(x>88951){printf("88969\n");return 0;}
else if(x>88937){printf("88951\n");return 0;}
else if(x>88919){printf("88937\n");return 0;}
else if(x>88903){printf("88919\n");return 0;}
else if(x>88897){printf("88903\n");return 0;}
else if(x>88883){printf("88897\n");return 0;}
else if(x>88873){printf("88883\n");return 0;}
else if(x>88867){printf("88873\n");return 0;}
else if(x>88861){printf("88867\n");return 0;}
else if(x>88853){printf("88861\n");return 0;}
else if(x>88843){printf("88853\n");return 0;}
else if(x>88819){printf("88843\n");return 0;}
else if(x>88817){printf("88819\n");return 0;}
else if(x>88813){printf("88817\n");return 0;}
else if(x>88811){printf("88813\n");return 0;}
else if(x>88807){printf("88811\n");return 0;}
else if(x>88801){printf("88807\n");return 0;}
else if(x>88799){printf("88801\n");return 0;}
else if(x>88793){printf("88799\n");return 0;}
else if(x>88789){printf("88793\n");return 0;}
else if(x>88771){printf("88789\n");return 0;}
else if(x>88747){printf("88771\n");return 0;}
else if(x>88741){printf("88747\n");return 0;}
else if(x>88729){printf("88741\n");return 0;}
else if(x>88721){printf("88729\n");return 0;}
else if(x>88681){printf("88721\n");return 0;}
else if(x>88667){printf("88681\n");return 0;}
else if(x>88663){printf("88667\n");return 0;}
else if(x>88661){printf("88663\n");return 0;}
else if(x>88657){printf("88661\n");return 0;}
else if(x>88651){printf("88657\n");return 0;}
else if(x>88643){printf("88651\n");return 0;}
else if(x>88609){printf("88643\n");return 0;}
else if(x>88607){printf("88609\n");return 0;}
else if(x>88591){printf("88607\n");return 0;}
else if(x>88589){printf("88591\n");return 0;}
else if(x>88547){printf("88589\n");return 0;}
else if(x>88523){printf("88547\n");return 0;}
else if(x>88513){printf("88523\n");return 0;}
else if(x>88499){printf("88513\n");return 0;}
else if(x>88493){printf("88499\n");return 0;}
else if(x>88471){printf("88493\n");return 0;}
else if(x>88469){printf("88471\n");return 0;}
else if(x>88463){printf("88469\n");return 0;}
else if(x>88427){printf("88463\n");return 0;}
else if(x>88423){printf("88427\n");return 0;}
else if(x>88411){printf("88423\n");return 0;}
else if(x>88397){printf("88411\n");return 0;}
else if(x>88379){printf("88397\n");return 0;}
else if(x>88339){printf("88379\n");return 0;}
else if(x>88337){printf("88339\n");return 0;}
else if(x>88327){printf("88337\n");return 0;}
else if(x>88321){printf("88327\n");return 0;}
else if(x>88301){printf("88321\n");return 0;}
else if(x>88289){printf("88301\n");return 0;}
else if(x>88261){printf("88289\n");return 0;}
else if(x>88259){printf("88261\n");return 0;}
else if(x>88241){printf("88259\n");return 0;}
else if(x>88237){printf("88241\n");return 0;}
else if(x>88223){printf("88237\n");return 0;}
else if(x>88211){printf("88223\n");return 0;}
else if(x>88177){printf("88211\n");return 0;}
else if(x>88169){printf("88177\n");return 0;}
else if(x>88129){printf("88169\n");return 0;}
else if(x>88117){printf("88129\n");return 0;}
else if(x>88093){printf("88117\n");return 0;}
else if(x>88079){printf("88093\n");return 0;}
else if(x>88069){printf("88079\n");return 0;}
else if(x>88037){printf("88069\n");return 0;}
else if(x>88019){printf("88037\n");return 0;}
else if(x>88007){printf("88019\n");return 0;}
else if(x>88003){printf("88007\n");return 0;}
else if(x>88001){printf("88003\n");return 0;}
else if(x>87991){printf("88001\n");return 0;}
else if(x>87977){printf("87991\n");return 0;}
else if(x>87973){printf("87977\n");return 0;}
else if(x>87961){printf("87973\n");return 0;}
else if(x>87959){printf("87961\n");return 0;}
else if(x>87943){printf("87959\n");return 0;}
else if(x>87931){printf("87943\n");return 0;}
else if(x>87917){printf("87931\n");return 0;}
else if(x>87911){printf("87917\n");return 0;}
else if(x>87887){printf("87911\n");return 0;}
else if(x>87881){printf("87887\n");return 0;}
else if(x>87877){printf("87881\n");return 0;}
else if(x>87869){printf("87877\n");return 0;}
else if(x>87853){printf("87869\n");return 0;}
else if(x>87833){printf("87853\n");return 0;}
else if(x>87811){printf("87833\n");return 0;}
else if(x>87803){printf("87811\n");return 0;}
else if(x>87797){printf("87803\n");return 0;}
else if(x>87793){printf("87797\n");return 0;}
else if(x>87767){printf("87793\n");return 0;}
else if(x>87751){printf("87767\n");return 0;}
else if(x>87743){printf("87751\n");return 0;}
else if(x>87739){printf("87743\n");return 0;}
else if(x>87721){printf("87739\n");return 0;}
else if(x>87719){printf("87721\n");return 0;}
else if(x>87701){printf("87719\n");return 0;}
else if(x>87697){printf("87701\n");return 0;}
else if(x>87691){printf("87697\n");return 0;}
else if(x>87683){printf("87691\n");return 0;}
else if(x>87679){printf("87683\n");return 0;}
else if(x>87671){printf("87679\n");return 0;}
else if(x>87649){printf("87671\n");return 0;}
else if(x>87643){printf("87649\n");return 0;}
else if(x>87641){printf("87643\n");return 0;}
else if(x>87631){printf("87641\n");return 0;}
else if(x>87629){printf("87631\n");return 0;}
else if(x>87623){printf("87629\n");return 0;}
else if(x>87613){printf("87623\n");return 0;}
else if(x>87589){printf("87613\n");return 0;}
else if(x>87587){printf("87589\n");return 0;}
else if(x>87583){printf("87587\n");return 0;}
else if(x>87559){printf("87583\n");return 0;}
else if(x>87557){printf("87559\n");return 0;}
else if(x>87553){printf("87557\n");return 0;}
else if(x>87547){printf("87553\n");return 0;}
else if(x>87541){printf("87547\n");return 0;}
else if(x>87539){printf("87541\n");return 0;}
else if(x>87523){printf("87539\n");return 0;}
else if(x>87517){printf("87523\n");return 0;}
else if(x>87511){printf("87517\n");return 0;}
else if(x>87509){printf("87511\n");return 0;}
else if(x>87491){printf("87509\n");return 0;}
else if(x>87481){printf("87491\n");return 0;}
else if(x>87473){printf("87481\n");return 0;}
else if(x>87443){printf("87473\n");return 0;}
else if(x>87433){printf("87443\n");return 0;}
else if(x>87427){printf("87433\n");return 0;}
else if(x>87421){printf("87427\n");return 0;}
else if(x>87407){printf("87421\n");return 0;}
else if(x>87403){printf("87407\n");return 0;}
else if(x>87383){printf("87403\n");return 0;}
else if(x>87359){printf("87383\n");return 0;}
else if(x>87337){printf("87359\n");return 0;}
else if(x>87323){printf("87337\n");return 0;}
else if(x>87317){printf("87323\n");return 0;}
else if(x>87313){printf("87317\n");return 0;}
else if(x>87299){printf("87313\n");return 0;}
else if(x>87293){printf("87299\n");return 0;}
else if(x>87281){printf("87293\n");return 0;}
else if(x>87277){printf("87281\n");return 0;}
else if(x>87257){printf("87277\n");return 0;}
else if(x>87253){printf("87257\n");return 0;}
else if(x>87251){printf("87253\n");return 0;}
else if(x>87223){printf("87251\n");return 0;}
else if(x>87221){printf("87223\n");return 0;}
else if(x>87211){printf("87221\n");return 0;}
else if(x>87187){printf("87211\n");return 0;}
else if(x>87181){printf("87187\n");return 0;}
else if(x>87179){printf("87181\n");return 0;}
else if(x>87151){printf("87179\n");return 0;}
else if(x>87149){printf("87151\n");return 0;}
else if(x>87133){printf("87149\n");return 0;}
else if(x>87121){printf("87133\n");return 0;}
else if(x>87119){printf("87121\n");return 0;}
else if(x>87107){printf("87119\n");return 0;}
else if(x>87103){printf("87107\n");return 0;}
else if(x>87083){printf("87103\n");return 0;}
else if(x>87071){printf("87083\n");return 0;}
else if(x>87049){printf("87071\n");return 0;}
else if(x>87041){printf("87049\n");return 0;}
else if(x>87037){printf("87041\n");return 0;}
else if(x>87013){printf("87037\n");return 0;}
else if(x>87011){printf("87013\n");return 0;}
else if(x>86993){printf("87011\n");return 0;}
else if(x>86981){printf("86993\n");return 0;}
else if(x>86969){printf("86981\n");return 0;}
else if(x>86959){printf("86969\n");return 0;}
else if(x>86951){printf("86959\n");return 0;}
else if(x>86939){printf("86951\n");return 0;}
else if(x>86929){printf("86939\n");return 0;}
else if(x>86927){printf("86929\n");return 0;}
else if(x>86923){printf("86927\n");return 0;}
else if(x>86869){printf("86923\n");return 0;}
else if(x>86861){printf("86869\n");return 0;}
else if(x>86857){printf("86861\n");return 0;}
else if(x>86851){printf("86857\n");return 0;}
else if(x>86843){printf("86851\n");return 0;}
else if(x>86837){printf("86843\n");return 0;}
else if(x>86813){printf("86837\n");return 0;}
else if(x>86783){printf("86813\n");return 0;}
else if(x>86771){printf("86783\n");return 0;}
else if(x>86767){printf("86771\n");return 0;}
else if(x>86753){printf("86767\n");return 0;}
else if(x>86743){printf("86753\n");return 0;}
else if(x>86729){printf("86743\n");return 0;}
else if(x>86719){printf("86729\n");return 0;}
else if(x>86711){printf("86719\n");return 0;}
else if(x>86693){printf("86711\n");return 0;}
else if(x>86689){printf("86693\n");return 0;}
else if(x>86677){printf("86689\n");return 0;}
else if(x>86629){printf("86677\n");return 0;}
else if(x>86627){printf("86629\n");return 0;}
else if(x>86599){printf("86627\n");return 0;}
else if(x>86587){printf("86599\n");return 0;}
else if(x>86579){printf("86587\n");return 0;}
else if(x>86573){printf("86579\n");return 0;}
else if(x>86561){printf("86573\n");return 0;}
else if(x>86539){printf("86561\n");return 0;}
else if(x>86533){printf("86539\n");return 0;}
else if(x>86531){printf("86533\n");return 0;}
else if(x>86509){printf("86531\n");return 0;}
else if(x>86501){printf("86509\n");return 0;}
else if(x>86491){printf("86501\n");return 0;}
else if(x>86477){printf("86491\n");return 0;}
else if(x>86467){printf("86477\n");return 0;}
else if(x>86461){printf("86467\n");return 0;}
else if(x>86453){printf("86461\n");return 0;}
else if(x>86441){printf("86453\n");return 0;}
else if(x>86423){printf("86441\n");return 0;}
else if(x>86413){printf("86423\n");return 0;}
else if(x>86399){printf("86413\n");return 0;}
else if(x>86389){printf("86399\n");return 0;}
else if(x>86381){printf("86389\n");return 0;}
else if(x>86371){printf("86381\n");return 0;}
else if(x>86369){printf("86371\n");return 0;}
else if(x>86357){printf("86369\n");return 0;}
else if(x>86353){printf("86357\n");return 0;}
else if(x>86351){printf("86353\n");return 0;}
else if(x>86341){printf("86351\n");return 0;}
else if(x>86323){printf("86341\n");return 0;}
else if(x>86311){printf("86323\n");return 0;}
else if(x>86297){printf("86311\n");return 0;}
else if(x>86293){printf("86297\n");return 0;}
else if(x>86291){printf("86293\n");return 0;}
else if(x>86287){printf("86291\n");return 0;}
else if(x>86269){printf("86287\n");return 0;}
else if(x>86263){printf("86269\n");return 0;}
else if(x>86257){printf("86263\n");return 0;}
else if(x>86249){printf("86257\n");return 0;}
else if(x>86243){printf("86249\n");return 0;}
else if(x>86239){printf("86243\n");return 0;}
else if(x>86209){printf("86239\n");return 0;}
else if(x>86201){printf("86209\n");return 0;}
else if(x>86197){printf("86201\n");return 0;}
else if(x>86183){printf("86197\n");return 0;}
else if(x>86179){printf("86183\n");return 0;}
else if(x>86171){printf("86179\n");return 0;}
else if(x>86161){printf("86171\n");return 0;}
else if(x>86143){printf("86161\n");return 0;}
else if(x>86137){printf("86143\n");return 0;}
else if(x>86131){printf("86137\n");return 0;}
else if(x>86117){printf("86131\n");return 0;}
else if(x>86113){printf("86117\n");return 0;}
else if(x>86111){printf("86113\n");return 0;}
else if(x>86083){printf("86111\n");return 0;}
else if(x>86077){printf("86083\n");return 0;}
else if(x>86069){printf("86077\n");return 0;}
else if(x>86029){printf("86069\n");return 0;}
else if(x>86027){printf("86029\n");return 0;}
else if(x>86017){printf("86027\n");return 0;}
else if(x>86011){printf("86017\n");return 0;}
else if(x>85999){printf("86011\n");return 0;}
else if(x>85991){printf("85999\n");return 0;}
else if(x>85933){printf("85991\n");return 0;}
else if(x>85931){printf("85933\n");return 0;}
else if(x>85909){printf("85931\n");return 0;}
else if(x>85903){printf("85909\n");return 0;}
else if(x>85889){printf("85903\n");return 0;}
else if(x>85853){printf("85889\n");return 0;}
else if(x>85847){printf("85853\n");return 0;}
else if(x>85843){printf("85847\n");return 0;}
else if(x>85837){printf("85843\n");return 0;}
else if(x>85831){printf("85837\n");return 0;}
else if(x>85829){printf("85831\n");return 0;}
else if(x>85819){printf("85829\n");return 0;}
else if(x>85817){printf("85819\n");return 0;}
else if(x>85793){printf("85817\n");return 0;}
else if(x>85781){printf("85793\n");return 0;}
else if(x>85751){printf("85781\n");return 0;}
else if(x>85733){printf("85751\n");return 0;}
else if(x>85717){printf("85733\n");return 0;}
else if(x>85711){printf("85717\n");return 0;}
else if(x>85703){printf("85711\n");return 0;}
else if(x>85691){printf("85703\n");return 0;}
else if(x>85669){printf("85691\n");return 0;}
else if(x>85667){printf("85669\n");return 0;}
else if(x>85661){printf("85667\n");return 0;}
else if(x>85643){printf("85661\n");return 0;}
else if(x>85639){printf("85643\n");return 0;}
else if(x>85627){printf("85639\n");return 0;}
else if(x>85621){printf("85627\n");return 0;}
else if(x>85619){printf("85621\n");return 0;}
else if(x>85607){printf("85619\n");return 0;}
else if(x>85601){printf("85607\n");return 0;}
else if(x>85597){printf("85601\n");return 0;}
else if(x>85577){printf("85597\n");return 0;}
else if(x>85571){printf("85577\n");return 0;}
else if(x>85549){printf("85571\n");return 0;}
else if(x>85531){printf("85549\n");return 0;}
else if(x>85523){printf("85531\n");return 0;}
else if(x>85517){printf("85523\n");return 0;}
else if(x>85513){printf("85517\n");return 0;}
else if(x>85487){printf("85513\n");return 0;}
else if(x>85469){printf("85487\n");return 0;}
else if(x>85453){printf("85469\n");return 0;}
else if(x>85451){printf("85453\n");return 0;}
else if(x>85447){printf("85451\n");return 0;}
else if(x>85439){printf("85447\n");return 0;}
else if(x>85429){printf("85439\n");return 0;}
else if(x>85427){printf("85429\n");return 0;}
else if(x>85411){printf("85427\n");return 0;}
else if(x>85381){printf("85411\n");return 0;}
else if(x>85369){printf("85381\n");return 0;}
else if(x>85363){printf("85369\n");return 0;}
else if(x>85361){printf("85363\n");return 0;}
else if(x>85333){printf("85361\n");return 0;}
else if(x>85331){printf("85333\n");return 0;}
else if(x>85313){printf("85331\n");return 0;}
else if(x>85303){printf("85313\n");return 0;}
else if(x>85297){printf("85303\n");return 0;}
else if(x>85259){printf("85297\n");return 0;}
else if(x>85247){printf("85259\n");return 0;}
else if(x>85243){printf("85247\n");return 0;}
else if(x>85237){printf("85243\n");return 0;}
else if(x>85229){printf("85237\n");return 0;}
else if(x>85223){printf("85229\n");return 0;}
else if(x>85213){printf("85223\n");return 0;}
else if(x>85201){printf("85213\n");return 0;}
else if(x>85199){printf("85201\n");return 0;}
else if(x>85193){printf("85199\n");return 0;}
else if(x>85159){printf("85193\n");return 0;}
else if(x>85147){printf("85159\n");return 0;}
else if(x>85133){printf("85147\n");return 0;}
else if(x>85121){printf("85133\n");return 0;}
else if(x>85109){printf("85121\n");return 0;}
else if(x>85103){printf("85109\n");return 0;}
else if(x>85093){printf("85103\n");return 0;}
else if(x>85091){printf("85093\n");return 0;}
else if(x>85087){printf("85091\n");return 0;}
else if(x>85081){printf("85087\n");return 0;}
else if(x>85061){printf("85081\n");return 0;}
else if(x>85049){printf("85061\n");return 0;}
else if(x>85037){printf("85049\n");return 0;}
else if(x>85027){printf("85037\n");return 0;}
else if(x>85021){printf("85027\n");return 0;}
else if(x>85009){printf("85021\n");return 0;}
else if(x>84991){printf("85009\n");return 0;}
else if(x>84979){printf("84991\n");return 0;}
else if(x>84977){printf("84979\n");return 0;}
else if(x>84967){printf("84977\n");return 0;}
else if(x>84961){printf("84967\n");return 0;}
else if(x>84947){printf("84961\n");return 0;}
else if(x>84919){printf("84947\n");return 0;}
else if(x>84913){printf("84919\n");return 0;}
else if(x>84871){printf("84913\n");return 0;}
else if(x>84869){printf("84871\n");return 0;}
else if(x>84859){printf("84869\n");return 0;}
else if(x>84857){printf("84859\n");return 0;}
else if(x>84827){printf("84857\n");return 0;}
else if(x>84811){printf("84827\n");return 0;}
else if(x>84809){printf("84811\n");return 0;}
else if(x>84793){printf("84809\n");return 0;}
else if(x>84787){printf("84793\n");return 0;}
else if(x>84761){printf("84787\n");return 0;}
else if(x>84751){printf("84761\n");return 0;}
else if(x>84737){printf("84751\n");return 0;}
else if(x>84731){printf("84737\n");return 0;}
else if(x>84719){printf("84731\n");return 0;}
else if(x>84713){printf("84719\n");return 0;}
else if(x>84701){printf("84713\n");return 0;}
else if(x>84697){printf("84701\n");return 0;}
else if(x>84691){printf("84697\n");return 0;}
else if(x>84673){printf("84691\n");return 0;}
else if(x>84659){printf("84673\n");return 0;}
else if(x>84653){printf("84659\n");return 0;}
else if(x>84649){printf("84653\n");return 0;}
else if(x>84631){printf("84649\n");return 0;}
else if(x>84629){printf("84631\n");return 0;}
else if(x>84589){printf("84629\n");return 0;}
else if(x>84559){printf("84589\n");return 0;}
else if(x>84551){printf("84559\n");return 0;}
else if(x>84533){printf("84551\n");return 0;}
else if(x>84523){printf("84533\n");return 0;}
else if(x>84521){printf("84523\n");return 0;}
else if(x>84509){printf("84521\n");return 0;}
else if(x>84503){printf("84509\n");return 0;}
else if(x>84499){printf("84503\n");return 0;}
else if(x>84481){printf("84499\n");return 0;}
else if(x>84467){printf("84481\n");return 0;}
else if(x>84463){printf("84467\n");return 0;}
else if(x>84457){printf("84463\n");return 0;}
else if(x>84449){printf("84457\n");return 0;}
else if(x>84443){printf("84449\n");return 0;}
else if(x>84437){printf("84443\n");return 0;}
else if(x>84431){printf("84437\n");return 0;}
else if(x>84421){printf("84431\n");return 0;}
else if(x>84407){printf("84421\n");return 0;}
else if(x>84401){printf("84407\n");return 0;}
else if(x>84391){printf("84401\n");return 0;}
else if(x>84389){printf("84391\n");return 0;}
else if(x>84377){printf("84389\n");return 0;}
else if(x>84349){printf("84377\n");return 0;}
else if(x>84347){printf("84349\n");return 0;}
else if(x>84319){printf("84347\n");return 0;}
else if(x>84317){printf("84319\n");return 0;}
else if(x>84313){printf("84317\n");return 0;}
else if(x>84307){printf("84313\n");return 0;}
else if(x>84299){printf("84307\n");return 0;}
else if(x>84263){printf("84299\n");return 0;}
else if(x>84247){printf("84263\n");return 0;}
else if(x>84239){printf("84247\n");return 0;}
else if(x>84229){printf("84239\n");return 0;}
else if(x>84223){printf("84229\n");return 0;}
else if(x>84221){printf("84223\n");return 0;}
else if(x>84211){printf("84221\n");return 0;}
else if(x>84199){printf("84211\n");return 0;}
else if(x>84191){printf("84199\n");return 0;}
else if(x>84181){printf("84191\n");return 0;}
else if(x>84179){printf("84181\n");return 0;}
else if(x>84163){printf("84179\n");return 0;}
else if(x>84143){printf("84163\n");return 0;}
else if(x>84137){printf("84143\n");return 0;}
else if(x>84131){printf("84137\n");return 0;}
else if(x>84127){printf("84131\n");return 0;}
else if(x>84121){printf("84127\n");return 0;}
else if(x>84089){printf("84121\n");return 0;}
else if(x>84067){printf("84089\n");return 0;}
else if(x>84061){printf("84067\n");return 0;}
else if(x>84059){printf("84061\n");return 0;}
else if(x>84053){printf("84059\n");return 0;}
else if(x>84047){printf("84053\n");return 0;}
else if(x>84017){printf("84047\n");return 0;}
else if(x>84011){printf("84017\n");return 0;}
else if(x>83987){printf("84011\n");return 0;}
else if(x>83983){printf("83987\n");return 0;}
else if(x>83969){printf("83983\n");return 0;}
else if(x>83939){printf("83969\n");return 0;}
else if(x>83933){printf("83939\n");return 0;}
else if(x>83921){printf("83933\n");return 0;}
else if(x>83911){printf("83921\n");return 0;}
else if(x>83903){printf("83911\n");return 0;}
else if(x>83891){printf("83903\n");return 0;}
else if(x>83873){printf("83891\n");return 0;}
else if(x>83869){printf("83873\n");return 0;}
else if(x>83857){printf("83869\n");return 0;}
else if(x>83843){printf("83857\n");return 0;}
else if(x>83833){printf("83843\n");return 0;}
else if(x>83813){printf("83833\n");return 0;}
else if(x>83791){printf("83813\n");return 0;}
else if(x>83777){printf("83791\n");return 0;}
else if(x>83773){printf("83777\n");return 0;}
else if(x>83761){printf("83773\n");return 0;}
else if(x>83737){printf("83761\n");return 0;}
else if(x>83719){printf("83737\n");return 0;}
else if(x>83717){printf("83719\n");return 0;}
else if(x>83701){printf("83717\n");return 0;}
else if(x>83689){printf("83701\n");return 0;}
else if(x>83663){printf("83689\n");return 0;}
else if(x>83653){printf("83663\n");return 0;}
else if(x>83641){printf("83653\n");return 0;}
else if(x>83639){printf("83641\n");return 0;}
else if(x>83621){printf("83639\n");return 0;}
else if(x>83617){printf("83621\n");return 0;}
else if(x>83609){printf("83617\n");return 0;}
else if(x>83597){printf("83609\n");return 0;}
else if(x>83591){printf("83597\n");return 0;}
else if(x>83579){printf("83591\n");return 0;}
else if(x>83563){printf("83579\n");return 0;}
else if(x>83561){printf("83563\n");return 0;}
else if(x>83557){printf("83561\n");return 0;}
else if(x>83537){printf("83557\n");return 0;}
else if(x>83497){printf("83537\n");return 0;}
else if(x>83477){printf("83497\n");return 0;}
else if(x>83471){printf("83477\n");return 0;}
else if(x>83459){printf("83471\n");return 0;}
else if(x>83449){printf("83459\n");return 0;}
else if(x>83443){printf("83449\n");return 0;}
else if(x>83437){printf("83443\n");return 0;}
else if(x>83431){printf("83437\n");return 0;}
else if(x>83423){printf("83431\n");return 0;}
else if(x>83417){printf("83423\n");return 0;}
else if(x>83407){printf("83417\n");return 0;}
else if(x>83401){printf("83407\n");return 0;}
else if(x>83399){printf("83401\n");return 0;}
else if(x>83389){printf("83399\n");return 0;}
else if(x>83383){printf("83389\n");return 0;}
else if(x>83357){printf("83383\n");return 0;}
else if(x>83341){printf("83357\n");return 0;}
else if(x>83339){printf("83341\n");return 0;}
else if(x>83311){printf("83339\n");return 0;}
else if(x>83299){printf("83311\n");return 0;}
else if(x>83273){printf("83299\n");return 0;}
else if(x>83269){printf("83273\n");return 0;}
else if(x>83267){printf("83269\n");return 0;}
else if(x>83257){printf("83267\n");return 0;}
else if(x>83243){printf("83257\n");return 0;}
else if(x>83233){printf("83243\n");return 0;}
else if(x>83231){printf("83233\n");return 0;}
else if(x>83227){printf("83231\n");return 0;}
else if(x>83221){printf("83227\n");return 0;}
else if(x>83219){printf("83221\n");return 0;}
else if(x>83207){printf("83219\n");return 0;}
else if(x>83203){printf("83207\n");return 0;}
else if(x>83177){printf("83203\n");return 0;}
else if(x>83137){printf("83177\n");return 0;}
else if(x>83117){printf("83137\n");return 0;}
else if(x>83101){printf("83117\n");return 0;}
else if(x>83093){printf("83101\n");return 0;}
else if(x>83089){printf("83093\n");return 0;}
else if(x>83077){printf("83089\n");return 0;}
else if(x>83071){printf("83077\n");return 0;}
else if(x>83063){printf("83071\n");return 0;}
else if(x>83059){printf("83063\n");return 0;}
else if(x>83047){printf("83059\n");return 0;}
else if(x>83023){printf("83047\n");return 0;}
else if(x>83009){printf("83023\n");return 0;}
else if(x>83003){printf("83009\n");return 0;}
else if(x>82997){printf("83003\n");return 0;}
else if(x>82981){printf("82997\n");return 0;}
else if(x>82963){printf("82981\n");return 0;}
else if(x>82939){printf("82963\n");return 0;}
else if(x>82913){printf("82939\n");return 0;}
else if(x>82903){printf("82913\n");return 0;}
else if(x>82891){printf("82903\n");return 0;}
else if(x>82889){printf("82891\n");return 0;}
else if(x>82883){printf("82889\n");return 0;}
else if(x>82847){printf("82883\n");return 0;}
else if(x>82837){printf("82847\n");return 0;}
else if(x>82813){printf("82837\n");return 0;}
else if(x>82811){printf("82813\n");return 0;}
else if(x>82799){printf("82811\n");return 0;}
else if(x>82793){printf("82799\n");return 0;}
else if(x>82787){printf("82793\n");return 0;}
else if(x>82781){printf("82787\n");return 0;}
else if(x>82763){printf("82781\n");return 0;}
else if(x>82759){printf("82763\n");return 0;}
else if(x>82757){printf("82759\n");return 0;}
else if(x>82729){printf("82757\n");return 0;}
else if(x>82727){printf("82729\n");return 0;}
else if(x>82723){printf("82727\n");return 0;}
else if(x>82721){printf("82723\n");return 0;}
else if(x>82699){printf("82721\n");return 0;}
else if(x>82657){printf("82699\n");return 0;}
else if(x>82651){printf("82657\n");return 0;}
else if(x>82633){printf("82651\n");return 0;}
else if(x>82619){printf("82633\n");return 0;}
else if(x>82613){printf("82619\n");return 0;}
else if(x>82609){printf("82613\n");return 0;}
else if(x>82601){printf("82609\n");return 0;}
else if(x>82591){printf("82601\n");return 0;}
else if(x>82571){printf("82591\n");return 0;}
else if(x>82567){printf("82571\n");return 0;}
else if(x>82561){printf("82567\n");return 0;}
else if(x>82559){printf("82561\n");return 0;}
else if(x>82549){printf("82559\n");return 0;}
else if(x>82531){printf("82549\n");return 0;}
else if(x>82529){printf("82531\n");return 0;}
else if(x>82507){printf("82529\n");return 0;}
else if(x>82499){printf("82507\n");return 0;}
else if(x>82493){printf("82499\n");return 0;}
else if(x>82487){printf("82493\n");return 0;}
else if(x>82483){printf("82487\n");return 0;}
else if(x>82471){printf("82483\n");return 0;}
else if(x>82469){printf("82471\n");return 0;}
else if(x>82463){printf("82469\n");return 0;}
else if(x>82457){printf("82463\n");return 0;}
else if(x>82421){printf("82457\n");return 0;}
else if(x>82393){printf("82421\n");return 0;}
else if(x>82387){printf("82393\n");return 0;}
else if(x>82373){printf("82387\n");return 0;}
else if(x>82361){printf("82373\n");return 0;}
else if(x>82351){printf("82361\n");return 0;}
else if(x>82349){printf("82351\n");return 0;}
else if(x>82339){printf("82349\n");return 0;}
else if(x>82307){printf("82339\n");return 0;}
else if(x>82301){printf("82307\n");return 0;}
else if(x>82279){printf("82301\n");return 0;}
else if(x>82267){printf("82279\n");return 0;}
else if(x>82261){printf("82267\n");return 0;}
else if(x>82241){printf("82261\n");return 0;}
else if(x>82237){printf("82241\n");return 0;}
else if(x>82231){printf("82237\n");return 0;}
else if(x>82223){printf("82231\n");return 0;}
else if(x>82219){printf("82223\n");return 0;}
else if(x>82217){printf("82219\n");return 0;}
else if(x>82207){printf("82217\n");return 0;}
else if(x>82193){printf("82207\n");return 0;}
else if(x>82189){printf("82193\n");return 0;}
else if(x>82183){printf("82189\n");return 0;}
else if(x>82171){printf("82183\n");return 0;}
else if(x>82163){printf("82171\n");return 0;}
else if(x>82153){printf("82163\n");return 0;}
else if(x>82141){printf("82153\n");return 0;}
else if(x>82139){printf("82141\n");return 0;}
else if(x>82129){printf("82139\n");return 0;}
else if(x>82073){printf("82129\n");return 0;}
else if(x>82067){printf("82073\n");return 0;}
else if(x>82051){printf("82067\n");return 0;}
else if(x>82039){printf("82051\n");return 0;}
else if(x>82037){printf("82039\n");return 0;}
else if(x>82031){printf("82037\n");return 0;}
else if(x>82021){printf("82031\n");return 0;}
else if(x>82013){printf("82021\n");return 0;}
else if(x>82009){printf("82013\n");return 0;}
else if(x>82007){printf("82009\n");return 0;}
else if(x>82003){printf("82007\n");return 0;}
else if(x>81973){printf("82003\n");return 0;}
else if(x>81971){printf("81973\n");return 0;}
else if(x>81967){printf("81971\n");return 0;}
else if(x>81953){printf("81967\n");return 0;}
else if(x>81943){printf("81953\n");return 0;}
else if(x>81937){printf("81943\n");return 0;}
else if(x>81931){printf("81937\n");return 0;}
else if(x>81929){printf("81931\n");return 0;}
else if(x>81919){printf("81929\n");return 0;}
else if(x>81901){printf("81919\n");return 0;}
else if(x>81899){printf("81901\n");return 0;}
else if(x>81883){printf("81899\n");return 0;}
else if(x>81869){printf("81883\n");return 0;}
else if(x>81853){printf("81869\n");return 0;}
else if(x>81847){printf("81853\n");return 0;}
else if(x>81839){printf("81847\n");return 0;}
else if(x>81817){printf("81839\n");return 0;}
else if(x>81799){printf("81817\n");return 0;}
else if(x>81773){printf("81799\n");return 0;}
else if(x>81769){printf("81773\n");return 0;}
else if(x>81761){printf("81769\n");return 0;}
else if(x>81749){printf("81761\n");return 0;}
else if(x>81737){printf("81749\n");return 0;}
else if(x>81727){printf("81737\n");return 0;}
else if(x>81707){printf("81727\n");return 0;}
else if(x>81703){printf("81707\n");return 0;}
else if(x>81701){printf("81703\n");return 0;}
else if(x>81689){printf("81701\n");return 0;}
else if(x>81677){printf("81689\n");return 0;}
else if(x>81671){printf("81677\n");return 0;}
else if(x>81667){printf("81671\n");return 0;}
else if(x>81649){printf("81667\n");return 0;}
else if(x>81647){printf("81649\n");return 0;}
else if(x>81637){printf("81647\n");return 0;}
else if(x>81629){printf("81637\n");return 0;}
else if(x>81619){printf("81629\n");return 0;}
else if(x>81611){printf("81619\n");return 0;}
else if(x>81569){printf("81611\n");return 0;}
else if(x>81563){printf("81569\n");return 0;}
else if(x>81559){printf("81563\n");return 0;}
else if(x>81553){printf("81559\n");return 0;}
else if(x>81551){printf("81553\n");return 0;}
else if(x>81547){printf("81551\n");return 0;}
else if(x>81533){printf("81547\n");return 0;}
else if(x>81527){printf("81533\n");return 0;}
else if(x>81517){printf("81527\n");return 0;}
else if(x>81509){printf("81517\n");return 0;}
else if(x>81463){printf("81509\n");return 0;}
else if(x>81457){printf("81463\n");return 0;}
else if(x>81439){printf("81457\n");return 0;}
else if(x>81421){printf("81439\n");return 0;}
else if(x>81409){printf("81421\n");return 0;}
else if(x>81401){printf("81409\n");return 0;}
else if(x>81373){printf("81401\n");return 0;}
else if(x>81371){printf("81373\n");return 0;}
else if(x>81359){printf("81371\n");return 0;}
else if(x>81353){printf("81359\n");return 0;}
else if(x>81349){printf("81353\n");return 0;}
else if(x>81343){printf("81349\n");return 0;}
else if(x>81331){printf("81343\n");return 0;}
else if(x>81307){printf("81331\n");return 0;}
else if(x>81299){printf("81307\n");return 0;}
else if(x>81293){printf("81299\n");return 0;}
else if(x>81283){printf("81293\n");return 0;}
else if(x>81281){printf("81283\n");return 0;}
else if(x>81239){printf("81281\n");return 0;}
else if(x>81233){printf("81239\n");return 0;}
else if(x>81223){printf("81233\n");return 0;}
else if(x>81203){printf("81223\n");return 0;}
else if(x>81199){printf("81203\n");return 0;}
else if(x>81197){printf("81199\n");return 0;}
else if(x>81181){printf("81197\n");return 0;}
else if(x>81173){printf("81181\n");return 0;}
else if(x>81163){printf("81173\n");return 0;}
else if(x>81157){printf("81163\n");return 0;}
else if(x>81131){printf("81157\n");return 0;}
else if(x>81119){printf("81131\n");return 0;}
else if(x>81101){printf("81119\n");return 0;}
else if(x>81097){printf("81101\n");return 0;}
else if(x>81083){printf("81097\n");return 0;}
else if(x>81077){printf("81083\n");return 0;}
else if(x>81071){printf("81077\n");return 0;}
else if(x>81049){printf("81071\n");return 0;}
else if(x>81047){printf("81049\n");return 0;}
else if(x>81043){printf("81047\n");return 0;}
else if(x>81041){printf("81043\n");return 0;}
else if(x>81031){printf("81041\n");return 0;}
else if(x>81023){printf("81031\n");return 0;}
else if(x>81019){printf("81023\n");return 0;}
else if(x>81017){printf("81019\n");return 0;}
else if(x>81013){printf("81017\n");return 0;}
else if(x>81001){printf("81013\n");return 0;}
else if(x>80989){printf("81001\n");return 0;}
else if(x>80963){printf("80989\n");return 0;}
else if(x>80953){printf("80963\n");return 0;}
else if(x>80933){printf("80953\n");return 0;}
else if(x>80929){printf("80933\n");return 0;}
else if(x>80923){printf("80929\n");return 0;}
else if(x>80917){printf("80923\n");return 0;}
else if(x>80911){printf("80917\n");return 0;}
else if(x>80909){printf("80911\n");return 0;}
else if(x>80897){printf("80909\n");return 0;}
else if(x>80863){printf("80897\n");return 0;}
else if(x>80849){printf("80863\n");return 0;}
else if(x>80833){printf("80849\n");return 0;}
else if(x>80831){printf("80833\n");return 0;}
else if(x>80819){printf("80831\n");return 0;}
else if(x>80809){printf("80819\n");return 0;}
else if(x>80803){printf("80809\n");return 0;}
else if(x>80789){printf("80803\n");return 0;}
else if(x>80783){printf("80789\n");return 0;}
else if(x>80779){printf("80783\n");return 0;}
else if(x>80777){printf("80779\n");return 0;}
else if(x>80761){printf("80777\n");return 0;}
else if(x>80749){printf("80761\n");return 0;}
else if(x>80747){printf("80749\n");return 0;}
else if(x>80737){printf("80747\n");return 0;}
else if(x>80713){printf("80737\n");return 0;}
else if(x>80701){printf("80713\n");return 0;}
else if(x>80687){printf("80701\n");return 0;}
else if(x>80683){printf("80687\n");return 0;}
else if(x>80681){printf("80683\n");return 0;}
else if(x>80677){printf("80681\n");return 0;}
else if(x>80671){printf("80677\n");return 0;}
else if(x>80669){printf("80671\n");return 0;}
else if(x>80657){printf("80669\n");return 0;}
else if(x>80651){printf("80657\n");return 0;}
else if(x>80629){printf("80651\n");return 0;}
else if(x>80627){printf("80629\n");return 0;}
else if(x>80621){printf("80627\n");return 0;}
else if(x>80611){printf("80621\n");return 0;}
else if(x>80603){printf("80611\n");return 0;}
else if(x>80599){printf("80603\n");return 0;}
else if(x>80567){printf("80599\n");return 0;}
else if(x>80557){printf("80567\n");return 0;}
else if(x>80537){printf("80557\n");return 0;}
else if(x>80527){printf("80537\n");return 0;}
else if(x>80513){printf("80527\n");return 0;}
else if(x>80491){printf("80513\n");return 0;}
else if(x>80489){printf("80491\n");return 0;}
else if(x>80473){printf("80489\n");return 0;}
else if(x>80471){printf("80473\n");return 0;}
else if(x>80449){printf("80471\n");return 0;}
else if(x>80447){printf("80449\n");return 0;}
else if(x>80429){printf("80447\n");return 0;}
else if(x>80407){printf("80429\n");return 0;}
else if(x>80387){printf("80407\n");return 0;}
else if(x>80369){printf("80387\n");return 0;}
else if(x>80363){printf("80369\n");return 0;}
else if(x>80347){printf("80363\n");return 0;}
else if(x>80341){printf("80347\n");return 0;}
else if(x>80329){printf("80341\n");return 0;}
else if(x>80317){printf("80329\n");return 0;}
else if(x>80309){printf("80317\n");return 0;}
else if(x>80287){printf("80309\n");return 0;}
else if(x>80279){printf("80287\n");return 0;}
else if(x>80273){printf("80279\n");return 0;}
else if(x>80263){printf("80273\n");return 0;}
else if(x>80251){printf("80263\n");return 0;}
else if(x>80239){printf("80251\n");return 0;}
else if(x>80233){printf("80239\n");return 0;}
else if(x>80231){printf("80233\n");return 0;}
else if(x>80221){printf("80231\n");return 0;}
else if(x>80209){printf("80221\n");return 0;}
else if(x>80207){printf("80209\n");return 0;}
else if(x>80191){printf("80207\n");return 0;}
else if(x>80177){printf("80191\n");return 0;}
else if(x>80173){printf("80177\n");return 0;}
else if(x>80167){printf("80173\n");return 0;}
else if(x>80153){printf("80167\n");return 0;}
else if(x>80149){printf("80153\n");return 0;}
else if(x>80147){printf("80149\n");return 0;}
else if(x>80141){printf("80147\n");return 0;}
else if(x>80111){printf("80141\n");return 0;}
else if(x>80107){printf("80111\n");return 0;}
else if(x>80077){printf("80107\n");return 0;}
else if(x>80071){printf("80077\n");return 0;}
else if(x>80051){printf("80071\n");return 0;}
else if(x>80039){printf("80051\n");return 0;}
else if(x>80021){printf("80039\n");return 0;}
else if(x>79999){printf("80021\n");return 0;}
else if(x>79997){printf("79999\n");return 0;}
else if(x>79987){printf("79997\n");return 0;}
else if(x>79979){printf("79987\n");return 0;}
else if(x>79973){printf("79979\n");return 0;}
else if(x>79967){printf("79973\n");return 0;}
else if(x>79943){printf("79967\n");return 0;}
else if(x>79939){printf("79943\n");return 0;}
else if(x>79907){printf("79939\n");return 0;}
else if(x>79903){printf("79907\n");return 0;}
else if(x>79901){printf("79903\n");return 0;}
else if(x>79889){printf("79901\n");return 0;}
else if(x>79873){printf("79889\n");return 0;}
else if(x>79867){printf("79873\n");return 0;}
else if(x>79861){printf("79867\n");return 0;}
else if(x>79847){printf("79861\n");return 0;}
else if(x>79843){printf("79847\n");return 0;}
else if(x>79841){printf("79843\n");return 0;}
else if(x>79829){printf("79841\n");return 0;}
else if(x>79823){printf("79829\n");return 0;}
else if(x>79817){printf("79823\n");return 0;}
else if(x>79813){printf("79817\n");return 0;}
else if(x>79811){printf("79813\n");return 0;}
else if(x>79801){printf("79811\n");return 0;}
else if(x>79777){printf("79801\n");return 0;}
else if(x>79769){printf("79777\n");return 0;}
else if(x>79757){printf("79769\n");return 0;}
else if(x>79699){printf("79757\n");return 0;}
else if(x>79697){printf("79699\n");return 0;}
else if(x>79693){printf("79697\n");return 0;}
else if(x>79691){printf("79693\n");return 0;}
else if(x>79687){printf("79691\n");return 0;}
else if(x>79669){printf("79687\n");return 0;}
else if(x>79657){printf("79669\n");return 0;}
else if(x>79633){printf("79657\n");return 0;}
else if(x>79631){printf("79633\n");return 0;}
else if(x>79627){printf("79631\n");return 0;}
else if(x>79621){printf("79627\n");return 0;}
else if(x>79613){printf("79621\n");return 0;}
else if(x>79609){printf("79613\n");return 0;}
else if(x>79601){printf("79609\n");return 0;}
else if(x>79589){printf("79601\n");return 0;}
else if(x>79579){printf("79589\n");return 0;}
else if(x>79561){printf("79579\n");return 0;}
else if(x>79559){printf("79561\n");return 0;}
else if(x>79549){printf("79559\n");return 0;}
else if(x>79537){printf("79549\n");return 0;}
else if(x>79531){printf("79537\n");return 0;}
else if(x>79493){printf("79531\n");return 0;}
else if(x>79481){printf("79493\n");return 0;}
else if(x>79451){printf("79481\n");return 0;}
else if(x>79433){printf("79451\n");return 0;}
else if(x>79427){printf("79433\n");return 0;}
else if(x>79423){printf("79427\n");return 0;}
else if(x>79411){printf("79423\n");return 0;}
else if(x>79399){printf("79411\n");return 0;}
else if(x>79397){printf("79399\n");return 0;}
else if(x>79393){printf("79397\n");return 0;}
else if(x>79379){printf("79393\n");return 0;}
else if(x>79367){printf("79379\n");return 0;}
else if(x>79357){printf("79367\n");return 0;}
else if(x>79349){printf("79357\n");return 0;}
else if(x>79337){printf("79349\n");return 0;}
else if(x>79333){printf("79337\n");return 0;}
else if(x>79319){printf("79333\n");return 0;}
else if(x>79309){printf("79319\n");return 0;}
else if(x>79301){printf("79309\n");return 0;}
else if(x>79283){printf("79301\n");return 0;}
else if(x>79279){printf("79283\n");return 0;}
else if(x>79273){printf("79279\n");return 0;}
else if(x>79259){printf("79273\n");return 0;}
else if(x>79241){printf("79259\n");return 0;}
else if(x>79231){printf("79241\n");return 0;}
else if(x>79229){printf("79231\n");return 0;}
else if(x>79201){printf("79229\n");return 0;}
else if(x>79193){printf("79201\n");return 0;}
else if(x>79187){printf("79193\n");return 0;}
else if(x>79181){printf("79187\n");return 0;}
else if(x>79159){printf("79181\n");return 0;}
else if(x>79153){printf("79159\n");return 0;}
else if(x>79151){printf("79153\n");return 0;}
else if(x>79147){printf("79151\n");return 0;}
else if(x>79139){printf("79147\n");return 0;}
else if(x>79133){printf("79139\n");return 0;}
else if(x>79111){printf("79133\n");return 0;}
else if(x>79103){printf("79111\n");return 0;}
else if(x>79087){printf("79103\n");return 0;}
else if(x>79063){printf("79087\n");return 0;}
else if(x>79043){printf("79063\n");return 0;}
else if(x>79039){printf("79043\n");return 0;}
else if(x>79031){printf("79039\n");return 0;}
else if(x>78989){printf("79031\n");return 0;}
else if(x>78979){printf("78989\n");return 0;}
else if(x>78977){printf("78979\n");return 0;}
else if(x>78941){printf("78977\n");return 0;}
else if(x>78929){printf("78941\n");return 0;}
else if(x>78919){printf("78929\n");return 0;}
else if(x>78901){printf("78919\n");return 0;}
else if(x>78893){printf("78901\n");return 0;}
else if(x>78889){printf("78893\n");return 0;}
else if(x>78887){printf("78889\n");return 0;}
else if(x>78877){printf("78887\n");return 0;}
else if(x>78857){printf("78877\n");return 0;}
else if(x>78853){printf("78857\n");return 0;}
else if(x>78839){printf("78853\n");return 0;}
else if(x>78823){printf("78839\n");return 0;}
else if(x>78809){printf("78823\n");return 0;}
else if(x>78803){printf("78809\n");return 0;}
else if(x>78797){printf("78803\n");return 0;}
else if(x>78791){printf("78797\n");return 0;}
else if(x>78787){printf("78791\n");return 0;}
else if(x>78781){printf("78787\n");return 0;}
else if(x>78779){printf("78781\n");return 0;}
else if(x>78737){printf("78779\n");return 0;}
else if(x>78721){printf("78737\n");return 0;}
else if(x>78713){printf("78721\n");return 0;}
else if(x>78707){printf("78713\n");return 0;}
else if(x>78697){printf("78707\n");return 0;}
else if(x>78691){printf("78697\n");return 0;}
else if(x>78653){printf("78691\n");return 0;}
else if(x>78649){printf("78653\n");return 0;}
else if(x>78643){printf("78649\n");return 0;}
else if(x>78623){printf("78643\n");return 0;}
else if(x>78607){printf("78623\n");return 0;}
else if(x>78593){printf("78607\n");return 0;}
else if(x>78583){printf("78593\n");return 0;}
else if(x>78577){printf("78583\n");return 0;}
else if(x>78571){printf("78577\n");return 0;}
else if(x>78569){printf("78571\n");return 0;}
else if(x>78553){printf("78569\n");return 0;}
else if(x>78541){printf("78553\n");return 0;}
else if(x>78539){printf("78541\n");return 0;}
else if(x>78517){printf("78539\n");return 0;}
else if(x>78511){printf("78517\n");return 0;}
else if(x>78509){printf("78511\n");return 0;}
else if(x>78497){printf("78509\n");return 0;}
else if(x>78487){printf("78497\n");return 0;}
else if(x>78479){printf("78487\n");return 0;}
else if(x>78467){printf("78479\n");return 0;}
else if(x>78439){printf("78467\n");return 0;}
else if(x>78437){printf("78439\n");return 0;}
else if(x>78427){printf("78437\n");return 0;}
else if(x>78401){printf("78427\n");return 0;}
else if(x>78367){printf("78401\n");return 0;}
else if(x>78347){printf("78367\n");return 0;}
else if(x>78341){printf("78347\n");return 0;}
else if(x>78317){printf("78341\n");return 0;}
else if(x>78311){printf("78317\n");return 0;}
else if(x>78307){printf("78311\n");return 0;}
else if(x>78301){printf("78307\n");return 0;}
else if(x>78283){printf("78301\n");return 0;}
else if(x>78277){printf("78283\n");return 0;}
else if(x>78259){printf("78277\n");return 0;}
else if(x>78241){printf("78259\n");return 0;}
else if(x>78233){printf("78241\n");return 0;}
else if(x>78229){printf("78233\n");return 0;}
else if(x>78203){printf("78229\n");return 0;}
else if(x>78193){printf("78203\n");return 0;}
else if(x>78191){printf("78193\n");return 0;}
else if(x>78179){printf("78191\n");return 0;}
else if(x>78173){printf("78179\n");return 0;}
else if(x>78167){printf("78173\n");return 0;}
else if(x>78163){printf("78167\n");return 0;}
else if(x>78157){printf("78163\n");return 0;}
else if(x>78139){printf("78157\n");return 0;}
else if(x>78137){printf("78139\n");return 0;}
else if(x>78121){printf("78137\n");return 0;}
else if(x>78101){printf("78121\n");return 0;}
else if(x>78079){printf("78101\n");return 0;}
else if(x>78059){printf("78079\n");return 0;}
else if(x>78049){printf("78059\n");return 0;}
else if(x>78041){printf("78049\n");return 0;}
else if(x>78031){printf("78041\n");return 0;}
else if(x>78017){printf("78031\n");return 0;}
else if(x>78007){printf("78017\n");return 0;}
else if(x>77999){printf("78007\n");return 0;}
else if(x>77983){printf("77999\n");return 0;}
else if(x>77977){printf("77983\n");return 0;}
else if(x>77969){printf("77977\n");return 0;}
else if(x>77951){printf("77969\n");return 0;}
else if(x>77933){printf("77951\n");return 0;}
else if(x>77929){printf("77933\n");return 0;}
else if(x>77899){printf("77929\n");return 0;}
else if(x>77893){printf("77899\n");return 0;}
else if(x>77867){printf("77893\n");return 0;}
else if(x>77863){printf("77867\n");return 0;}
else if(x>77849){printf("77863\n");return 0;}
else if(x>77839){printf("77849\n");return 0;}
else if(x>77813){printf("77839\n");return 0;}
else if(x>77801){printf("77813\n");return 0;}
else if(x>77797){printf("77801\n");return 0;}
else if(x>77783){printf("77797\n");return 0;}
else if(x>77773){printf("77783\n");return 0;}
else if(x>77761){printf("77773\n");return 0;}
else if(x>77747){printf("77761\n");return 0;}
else if(x>77743){printf("77747\n");return 0;}
else if(x>77731){printf("77743\n");return 0;}
else if(x>77723){printf("77731\n");return 0;}
else if(x>77719){printf("77723\n");return 0;}
else if(x>77713){printf("77719\n");return 0;}
else if(x>77711){printf("77713\n");return 0;}
else if(x>77699){printf("77711\n");return 0;}
else if(x>77689){printf("77699\n");return 0;}
else if(x>77687){printf("77689\n");return 0;}
else if(x>77681){printf("77687\n");return 0;}
else if(x>77659){printf("77681\n");return 0;}
else if(x>77647){printf("77659\n");return 0;}
else if(x>77641){printf("77647\n");return 0;}
else if(x>77621){printf("77641\n");return 0;}
else if(x>77617){printf("77621\n");return 0;}
else if(x>77611){printf("77617\n");return 0;}
else if(x>77591){printf("77611\n");return 0;}
else if(x>77587){printf("77591\n");return 0;}
else if(x>77573){printf("77587\n");return 0;}
else if(x>77569){printf("77573\n");return 0;}
else if(x>77563){printf("77569\n");return 0;}
else if(x>77557){printf("77563\n");return 0;}
else if(x>77551){printf("77557\n");return 0;}
else if(x>77549){printf("77551\n");return 0;}
else if(x>77543){printf("77549\n");return 0;}
else if(x>77527){printf("77543\n");return 0;}
else if(x>77521){printf("77527\n");return 0;}
else if(x>77513){printf("77521\n");return 0;}
else if(x>77509){printf("77513\n");return 0;}
else if(x>77491){printf("77509\n");return 0;}
else if(x>77489){printf("77491\n");return 0;}
else if(x>77479){printf("77489\n");return 0;}
else if(x>77477){printf("77479\n");return 0;}
else if(x>77471){printf("77477\n");return 0;}
else if(x>77447){printf("77471\n");return 0;}
else if(x>77431){printf("77447\n");return 0;}
else if(x>77419){printf("77431\n");return 0;}
else if(x>77417){printf("77419\n");return 0;}
else if(x>77383){printf("77417\n");return 0;}
else if(x>77377){printf("77383\n");return 0;}
else if(x>77369){printf("77377\n");return 0;}
else if(x>77359){printf("77369\n");return 0;}
else if(x>77351){printf("77359\n");return 0;}
else if(x>77347){printf("77351\n");return 0;}
else if(x>77339){printf("77347\n");return 0;}
else if(x>77323){printf("77339\n");return 0;}
else if(x>77317){printf("77323\n");return 0;}
else if(x>77291){printf("77317\n");return 0;}
else if(x>77279){printf("77291\n");return 0;}
else if(x>77269){printf("77279\n");return 0;}
else if(x>77267){printf("77269\n");return 0;}
else if(x>77263){printf("77267\n");return 0;}
else if(x>77261){printf("77263\n");return 0;}
else if(x>77249){printf("77261\n");return 0;}
else if(x>77243){printf("77249\n");return 0;}
else if(x>77239){printf("77243\n");return 0;}
else if(x>77237){printf("77239\n");return 0;}
else if(x>77213){printf("77237\n");return 0;}
else if(x>77201){printf("77213\n");return 0;}
else if(x>77191){printf("77201\n");return 0;}
else if(x>77171){printf("77191\n");return 0;}
else if(x>77167){printf("77171\n");return 0;}
else if(x>77153){printf("77167\n");return 0;}
else if(x>77141){printf("77153\n");return 0;}
else if(x>77137){printf("77141\n");return 0;}
else if(x>77101){printf("77137\n");return 0;}
else if(x>77093){printf("77101\n");return 0;}
else if(x>77081){printf("77093\n");return 0;}
else if(x>77069){printf("77081\n");return 0;}
else if(x>77047){printf("77069\n");return 0;}
else if(x>77041){printf("77047\n");return 0;}
else if(x>77029){printf("77041\n");return 0;}
else if(x>77023){printf("77029\n");return 0;}
else if(x>77017){printf("77023\n");return 0;}
else if(x>77003){printf("77017\n");return 0;}
else if(x>76991){printf("77003\n");return 0;}
else if(x>76963){printf("76991\n");return 0;}
else if(x>76961){printf("76963\n");return 0;}
else if(x>76949){printf("76961\n");return 0;}
else if(x>76943){printf("76949\n");return 0;}
else if(x>76919){printf("76943\n");return 0;}
else if(x>76913){printf("76919\n");return 0;}
else if(x>76907){printf("76913\n");return 0;}
else if(x>76883){printf("76907\n");return 0;}
else if(x>76873){printf("76883\n");return 0;}
else if(x>76871){printf("76873\n");return 0;}
else if(x>76847){printf("76871\n");return 0;}
else if(x>76837){printf("76847\n");return 0;}
else if(x>76831){printf("76837\n");return 0;}
else if(x>76829){printf("76831\n");return 0;}
else if(x>76819){printf("76829\n");return 0;}
else if(x>76801){printf("76819\n");return 0;}
else if(x>76781){printf("76801\n");return 0;}
else if(x>76777){printf("76781\n");return 0;}
else if(x>76771){printf("76777\n");return 0;}
else if(x>76757){printf("76771\n");return 0;}
else if(x>76753){printf("76757\n");return 0;}
else if(x>76733){printf("76753\n");return 0;}
else if(x>76717){printf("76733\n");return 0;}
else if(x>76697){printf("76717\n");return 0;}
else if(x>76679){printf("76697\n");return 0;}
else if(x>76673){printf("76679\n");return 0;}
else if(x>76667){printf("76673\n");return 0;}
else if(x>76651){printf("76667\n");return 0;}
else if(x>76649){printf("76651\n");return 0;}
else if(x>76631){printf("76649\n");return 0;}
else if(x>76607){printf("76631\n");return 0;}
else if(x>76603){printf("76607\n");return 0;}
else if(x>76597){printf("76603\n");return 0;}
else if(x>76579){printf("76597\n");return 0;}
else if(x>76561){printf("76579\n");return 0;}
else if(x>76543){printf("76561\n");return 0;}
else if(x>76541){printf("76543\n");return 0;}
else if(x>76537){printf("76541\n");return 0;}
else if(x>76519){printf("76537\n");return 0;}
else if(x>76511){printf("76519\n");return 0;}
else if(x>76507){printf("76511\n");return 0;}
else if(x>76493){printf("76507\n");return 0;}
else if(x>76487){printf("76493\n");return 0;}
else if(x>76481){printf("76487\n");return 0;}
else if(x>76471){printf("76481\n");return 0;}
else if(x>76463){printf("76471\n");return 0;}
else if(x>76441){printf("76463\n");return 0;}
else if(x>76423){printf("76441\n");return 0;}
else if(x>76421){printf("76423\n");return 0;}
else if(x>76403){printf("76421\n");return 0;}
else if(x>76387){printf("76403\n");return 0;}
else if(x>76379){printf("76387\n");return 0;}
else if(x>76369){printf("76379\n");return 0;}
else if(x>76367){printf("76369\n");return 0;}
else if(x>76343){printf("76367\n");return 0;}
else if(x>76333){printf("76343\n");return 0;}
else if(x>76303){printf("76333\n");return 0;}
else if(x>76289){printf("76303\n");return 0;}
else if(x>76283){printf("76289\n");return 0;}
else if(x>76261){printf("76283\n");return 0;}
else if(x>76259){printf("76261\n");return 0;}
else if(x>76253){printf("76259\n");return 0;}
else if(x>76249){printf("76253\n");return 0;}
else if(x>76243){printf("76249\n");return 0;}
else if(x>76231){printf("76243\n");return 0;}
else if(x>76213){printf("76231\n");return 0;}
else if(x>76207){printf("76213\n");return 0;}
else if(x>76163){printf("76207\n");return 0;}
else if(x>76159){printf("76163\n");return 0;}
else if(x>76157){printf("76159\n");return 0;}
else if(x>76147){printf("76157\n");return 0;}
else if(x>76129){printf("76147\n");return 0;}
else if(x>76123){printf("76129\n");return 0;}
else if(x>76103){printf("76123\n");return 0;}
else if(x>76099){printf("76103\n");return 0;}
else if(x>76091){printf("76099\n");return 0;}
else if(x>76081){printf("76091\n");return 0;}
else if(x>76079){printf("76081\n");return 0;}
else if(x>76039){printf("76079\n");return 0;}
else if(x>76031){printf("76039\n");return 0;}
else if(x>76003){printf("76031\n");return 0;}
else if(x>76001){printf("76003\n");return 0;}
else if(x>75997){printf("76001\n");return 0;}
else if(x>75991){printf("75997\n");return 0;}
else if(x>75989){printf("75991\n");return 0;}
else if(x>75983){printf("75989\n");return 0;}
else if(x>75979){printf("75983\n");return 0;}
else if(x>75967){printf("75979\n");return 0;}
else if(x>75941){printf("75967\n");return 0;}
else if(x>75937){printf("75941\n");return 0;}
else if(x>75931){printf("75937\n");return 0;}
else if(x>75913){printf("75931\n");return 0;}
else if(x>75883){printf("75913\n");return 0;}
else if(x>75869){printf("75883\n");return 0;}
else if(x>75853){printf("75869\n");return 0;}
else if(x>75833){printf("75853\n");return 0;}
else if(x>75821){printf("75833\n");return 0;}
else if(x>75797){printf("75821\n");return 0;}
else if(x>75793){printf("75797\n");return 0;}
else if(x>75787){printf("75793\n");return 0;}
else if(x>75781){printf("75787\n");return 0;}
else if(x>75773){printf("75781\n");return 0;}
else if(x>75767){printf("75773\n");return 0;}
else if(x>75743){printf("75767\n");return 0;}
else if(x>75731){printf("75743\n");return 0;}
else if(x>75721){printf("75731\n");return 0;}
else if(x>75709){printf("75721\n");return 0;}
else if(x>75707){printf("75709\n");return 0;}
else if(x>75703){printf("75707\n");return 0;}
else if(x>75689){printf("75703\n");return 0;}
else if(x>75683){printf("75689\n");return 0;}
else if(x>75679){printf("75683\n");return 0;}
else if(x>75659){printf("75679\n");return 0;}
else if(x>75653){printf("75659\n");return 0;}
else if(x>75641){printf("75653\n");return 0;}
else if(x>75629){printf("75641\n");return 0;}
else if(x>75619){printf("75629\n");return 0;}
else if(x>75617){printf("75619\n");return 0;}
else if(x>75611){printf("75617\n");return 0;}
else if(x>75583){printf("75611\n");return 0;}
else if(x>75577){printf("75583\n");return 0;}
else if(x>75571){printf("75577\n");return 0;}
else if(x>75557){printf("75571\n");return 0;}
else if(x>75553){printf("75557\n");return 0;}
else if(x>75541){printf("75553\n");return 0;}
else if(x>75539){printf("75541\n");return 0;}
else if(x>75533){printf("75539\n");return 0;}
else if(x>75527){printf("75533\n");return 0;}
else if(x>75521){printf("75527\n");return 0;}
else if(x>75511){printf("75521\n");return 0;}
else if(x>75503){printf("75511\n");return 0;}
else if(x>75479){printf("75503\n");return 0;}
else if(x>75437){printf("75479\n");return 0;}
else if(x>75431){printf("75437\n");return 0;}
else if(x>75407){printf("75431\n");return 0;}
else if(x>75403){printf("75407\n");return 0;}
else if(x>75401){printf("75403\n");return 0;}
else if(x>75391){printf("75401\n");return 0;}
else if(x>75389){printf("75391\n");return 0;}
else if(x>75377){printf("75389\n");return 0;}
else if(x>75367){printf("75377\n");return 0;}
else if(x>75353){printf("75367\n");return 0;}
else if(x>75347){printf("75353\n");return 0;}
else if(x>75337){printf("75347\n");return 0;}
else if(x>75329){printf("75337\n");return 0;}
else if(x>75323){printf("75329\n");return 0;}
else if(x>75307){printf("75323\n");return 0;}
else if(x>75289){printf("75307\n");return 0;}
else if(x>75277){printf("75289\n");return 0;}
else if(x>75269){printf("75277\n");return 0;}
else if(x>75253){printf("75269\n");return 0;}
else if(x>75239){printf("75253\n");return 0;}
else if(x>75227){printf("75239\n");return 0;}
else if(x>75223){printf("75227\n");return 0;}
else if(x>75217){printf("75223\n");return 0;}
else if(x>75211){printf("75217\n");return 0;}
else if(x>75209){printf("75211\n");return 0;}
else if(x>75193){printf("75209\n");return 0;}
else if(x>75181){printf("75193\n");return 0;}
else if(x>75169){printf("75181\n");return 0;}
else if(x>75167){printf("75169\n");return 0;}
else if(x>75161){printf("75167\n");return 0;}
else if(x>75149){printf("75161\n");return 0;}
else if(x>75133){printf("75149\n");return 0;}
else if(x>75109){printf("75133\n");return 0;}
else if(x>75083){printf("75109\n");return 0;}
else if(x>75079){printf("75083\n");return 0;}
else if(x>75041){printf("75079\n");return 0;}
else if(x>75037){printf("75041\n");return 0;}
else if(x>75029){printf("75037\n");return 0;}
else if(x>75017){printf("75029\n");return 0;}
else if(x>75013){printf("75017\n");return 0;}
else if(x>75011){printf("75013\n");return 0;}
else if(x>74959){printf("75011\n");return 0;}
else if(x>74941){printf("74959\n");return 0;}
else if(x>74933){printf("74941\n");return 0;}
else if(x>74929){printf("74933\n");return 0;}
else if(x>74923){printf("74929\n");return 0;}
else if(x>74903){printf("74923\n");return 0;}
else if(x>74897){printf("74903\n");return 0;}
else if(x>74891){printf("74897\n");return 0;}
else if(x>74887){printf("74891\n");return 0;}
else if(x>74873){printf("74887\n");return 0;}
else if(x>74869){printf("74873\n");return 0;}
else if(x>74861){printf("74869\n");return 0;}
else if(x>74857){printf("74861\n");return 0;}
else if(x>74843){printf("74857\n");return 0;}
else if(x>74831){printf("74843\n");return 0;}
else if(x>74827){printf("74831\n");return 0;}
else if(x>74821){printf("74827\n");return 0;}
else if(x>74797){printf("74821\n");return 0;}
else if(x>74779){printf("74797\n");return 0;}
else if(x>74771){printf("74779\n");return 0;}
else if(x>74761){printf("74771\n");return 0;}
else if(x>74759){printf("74761\n");return 0;}
else if(x>74747){printf("74759\n");return 0;}
else if(x>74731){printf("74747\n");return 0;}
else if(x>74729){printf("74731\n");return 0;}
else if(x>74719){printf("74729\n");return 0;}
else if(x>74717){printf("74719\n");return 0;}
else if(x>74713){printf("74717\n");return 0;}
else if(x>74707){printf("74713\n");return 0;}
else if(x>74699){printf("74707\n");return 0;}
else if(x>74687){printf("74699\n");return 0;}
else if(x>74653){printf("74687\n");return 0;}
else if(x>74623){printf("74653\n");return 0;}
else if(x>74611){printf("74623\n");return 0;}
else if(x>74609){printf("74611\n");return 0;}
else if(x>74597){printf("74609\n");return 0;}
else if(x>74587){printf("74597\n");return 0;}
else if(x>74573){printf("74587\n");return 0;}
else if(x>74567){printf("74573\n");return 0;}
else if(x>74561){printf("74567\n");return 0;}
else if(x>74551){printf("74561\n");return 0;}
else if(x>74531){printf("74551\n");return 0;}
else if(x>74527){printf("74531\n");return 0;}
else if(x>74521){printf("74527\n");return 0;}
else if(x>74509){printf("74521\n");return 0;}
else if(x>74507){printf("74509\n");return 0;}
else if(x>74489){printf("74507\n");return 0;}
else if(x>74471){printf("74489\n");return 0;}
else if(x>74453){printf("74471\n");return 0;}
else if(x>74449){printf("74453\n");return 0;}
else if(x>74441){printf("74449\n");return 0;}
else if(x>74419){printf("74441\n");return 0;}
else if(x>74413){printf("74419\n");return 0;}
else if(x>74411){printf("74413\n");return 0;}
else if(x>74383){printf("74411\n");return 0;}
else if(x>74381){printf("74383\n");return 0;}
else if(x>74377){printf("74381\n");return 0;}
else if(x>74363){printf("74377\n");return 0;}
else if(x>74357){printf("74363\n");return 0;}
else if(x>74353){printf("74357\n");return 0;}
else if(x>74323){printf("74353\n");return 0;}
else if(x>74317){printf("74323\n");return 0;}
else if(x>74311){printf("74317\n");return 0;}
else if(x>74297){printf("74311\n");return 0;}
else if(x>74293){printf("74297\n");return 0;}
else if(x>74287){printf("74293\n");return 0;}
else if(x>74279){printf("74287\n");return 0;}
else if(x>74257){printf("74279\n");return 0;}
else if(x>74231){printf("74257\n");return 0;}
else if(x>74219){printf("74231\n");return 0;}
else if(x>74209){printf("74219\n");return 0;}
else if(x>74203){printf("74209\n");return 0;}
else if(x>74201){printf("74203\n");return 0;}
else if(x>74197){printf("74201\n");return 0;}
else if(x>74189){printf("74197\n");return 0;}
else if(x>74177){printf("74189\n");return 0;}
else if(x>74167){printf("74177\n");return 0;}
else if(x>74161){printf("74167\n");return 0;}
else if(x>74159){printf("74161\n");return 0;}
else if(x>74149){printf("74159\n");return 0;}
else if(x>74143){printf("74149\n");return 0;}
else if(x>74131){printf("74143\n");return 0;}
else if(x>74101){printf("74131\n");return 0;}
else if(x>74099){printf("74101\n");return 0;}
else if(x>74093){printf("74099\n");return 0;}
else if(x>74077){printf("74093\n");return 0;}
else if(x>74071){printf("74077\n");return 0;}
else if(x>74051){printf("74071\n");return 0;}
else if(x>74047){printf("74051\n");return 0;}
else if(x>74027){printf("74047\n");return 0;}
else if(x>74021){printf("74027\n");return 0;}
else if(x>74017){printf("74021\n");return 0;}
else if(x>73999){printf("74017\n");return 0;}
else if(x>73973){printf("73999\n");return 0;}
else if(x>73961){printf("73973\n");return 0;}
else if(x>73951){printf("73961\n");return 0;}
else if(x>73943){printf("73951\n");return 0;}
else if(x>73939){printf("73943\n");return 0;}
else if(x>73907){printf("73939\n");return 0;}
else if(x>73897){printf("73907\n");return 0;}
else if(x>73883){printf("73897\n");return 0;}
else if(x>73877){printf("73883\n");return 0;}
else if(x>73867){printf("73877\n");return 0;}
else if(x>73859){printf("73867\n");return 0;}
else if(x>73849){printf("73859\n");return 0;}
else if(x>73847){printf("73849\n");return 0;}
else if(x>73823){printf("73847\n");return 0;}
else if(x>73819){printf("73823\n");return 0;}
else if(x>73783){printf("73819\n");return 0;}
else if(x>73771){printf("73783\n");return 0;}
else if(x>73757){printf("73771\n");return 0;}
else if(x>73751){printf("73757\n");return 0;}
else if(x>73727){printf("73751\n");return 0;}
else if(x>73721){printf("73727\n");return 0;}
else if(x>73709){printf("73721\n");return 0;}
else if(x>73699){printf("73709\n");return 0;}
else if(x>73693){printf("73699\n");return 0;}
else if(x>73681){printf("73693\n");return 0;}
else if(x>73679){printf("73681\n");return 0;}
else if(x>73673){printf("73679\n");return 0;}
else if(x>73651){printf("73673\n");return 0;}
else if(x>73643){printf("73651\n");return 0;}
else if(x>73637){printf("73643\n");return 0;}
else if(x>73613){printf("73637\n");return 0;}
else if(x>73609){printf("73613\n");return 0;}
else if(x>73607){printf("73609\n");return 0;}
else if(x>73597){printf("73607\n");return 0;}
else if(x>73589){printf("73597\n");return 0;}
else if(x>73583){printf("73589\n");return 0;}
else if(x>73571){printf("73583\n");return 0;}
else if(x>73561){printf("73571\n");return 0;}
else if(x>73553){printf("73561\n");return 0;}
else if(x>73547){printf("73553\n");return 0;}
else if(x>73529){printf("73547\n");return 0;}
else if(x>73523){printf("73529\n");return 0;}
else if(x>73517){printf("73523\n");return 0;}
else if(x>73483){printf("73517\n");return 0;}
else if(x>73477){printf("73483\n");return 0;}
else if(x>73471){printf("73477\n");return 0;}
else if(x>73459){printf("73471\n");return 0;}
else if(x>73453){printf("73459\n");return 0;}
else if(x>73433){printf("73453\n");return 0;}
else if(x>73421){printf("73433\n");return 0;}
else if(x>73417){printf("73421\n");return 0;}
else if(x>73387){printf("73417\n");return 0;}
else if(x>73379){printf("73387\n");return 0;}
else if(x>73369){printf("73379\n");return 0;}
else if(x>73363){printf("73369\n");return 0;}
else if(x>73361){printf("73363\n");return 0;}
else if(x>73351){printf("73361\n");return 0;}
else if(x>73331){printf("73351\n");return 0;}
else if(x>73327){printf("73331\n");return 0;}
else if(x>73309){printf("73327\n");return 0;}
else if(x>73303){printf("73309\n");return 0;}
else if(x>73291){printf("73303\n");return 0;}
else if(x>73277){printf("73291\n");return 0;}
else if(x>73259){printf("73277\n");return 0;}
else if(x>73243){printf("73259\n");return 0;}
else if(x>73237){printf("73243\n");return 0;}
else if(x>73189){printf("73237\n");return 0;}
else if(x>73181){printf("73189\n");return 0;}
else if(x>73141){printf("73181\n");return 0;}
else if(x>73133){printf("73141\n");return 0;}
else if(x>73127){printf("73133\n");return 0;}
else if(x>73121){printf("73127\n");return 0;}
else if(x>73091){printf("73121\n");return 0;}
else if(x>73079){printf("73091\n");return 0;}
else if(x>73063){printf("73079\n");return 0;}
else if(x>73061){printf("73063\n");return 0;}
else if(x>73043){printf("73061\n");return 0;}
else if(x>73039){printf("73043\n");return 0;}
else if(x>73037){printf("73039\n");return 0;}
else if(x>73019){printf("73037\n");return 0;}
else if(x>73013){printf("73019\n");return 0;}
else if(x>73009){printf("73013\n");return 0;}
else if(x>72997){printf("73009\n");return 0;}
else if(x>72977){printf("72997\n");return 0;}
else if(x>72973){printf("72977\n");return 0;}
else if(x>72959){printf("72973\n");return 0;}
else if(x>72953){printf("72959\n");return 0;}
else if(x>72949){printf("72953\n");return 0;}
else if(x>72937){printf("72949\n");return 0;}
else if(x>72931){printf("72937\n");return 0;}
else if(x>72923){printf("72931\n");return 0;}
else if(x>72911){printf("72923\n");return 0;}
else if(x>72907){printf("72911\n");return 0;}
else if(x>72901){printf("72907\n");return 0;}
else if(x>72893){printf("72901\n");return 0;}
else if(x>72889){printf("72893\n");return 0;}
else if(x>72883){printf("72889\n");return 0;}
else if(x>72871){printf("72883\n");return 0;}
else if(x>72869){printf("72871\n");return 0;}
else if(x>72859){printf("72869\n");return 0;}
else if(x>72823){printf("72859\n");return 0;}
else if(x>72817){printf("72823\n");return 0;}
else if(x>72797){printf("72817\n");return 0;}
else if(x>72767){printf("72797\n");return 0;}
else if(x>72763){printf("72767\n");return 0;}
else if(x>72739){printf("72763\n");return 0;}
else if(x>72733){printf("72739\n");return 0;}
else if(x>72727){printf("72733\n");return 0;}
else if(x>72719){printf("72727\n");return 0;}
else if(x>72707){printf("72719\n");return 0;}
else if(x>72701){printf("72707\n");return 0;}
else if(x>72689){printf("72701\n");return 0;}
else if(x>72679){printf("72689\n");return 0;}
else if(x>72673){printf("72679\n");return 0;}
else if(x>72671){printf("72673\n");return 0;}
else if(x>72661){printf("72671\n");return 0;}
else if(x>72649){printf("72661\n");return 0;}
else if(x>72647){printf("72649\n");return 0;}
else if(x>72643){printf("72647\n");return 0;}
else if(x>72623){printf("72643\n");return 0;}
else if(x>72617){printf("72623\n");return 0;}
else if(x>72613){printf("72617\n");return 0;}
else if(x>72577){printf("72613\n");return 0;}
else if(x>72559){printf("72577\n");return 0;}
else if(x>72551){printf("72559\n");return 0;}
else if(x>72547){printf("72551\n");return 0;}
else if(x>72533){printf("72547\n");return 0;}
else if(x>72503){printf("72533\n");return 0;}
else if(x>72497){printf("72503\n");return 0;}
else if(x>72493){printf("72497\n");return 0;}
else if(x>72481){printf("72493\n");return 0;}
else if(x>72469){printf("72481\n");return 0;}
else if(x>72467){printf("72469\n");return 0;}
else if(x>72461){printf("72467\n");return 0;}
else if(x>72431){printf("72461\n");return 0;}
else if(x>72421){printf("72431\n");return 0;}
else if(x>72383){printf("72421\n");return 0;}
else if(x>72379){printf("72383\n");return 0;}
else if(x>72367){printf("72379\n");return 0;}
else if(x>72353){printf("72367\n");return 0;}
else if(x>72341){printf("72353\n");return 0;}
else if(x>72337){printf("72341\n");return 0;}
else if(x>72313){printf("72337\n");return 0;}
else if(x>72307){printf("72313\n");return 0;}
else if(x>72287){printf("72307\n");return 0;}
else if(x>72277){printf("72287\n");return 0;}
else if(x>72271){printf("72277\n");return 0;}
else if(x>72269){printf("72271\n");return 0;}
else if(x>72253){printf("72269\n");return 0;}
else if(x>72251){printf("72253\n");return 0;}
else if(x>72229){printf("72251\n");return 0;}
else if(x>72227){printf("72229\n");return 0;}
else if(x>72223){printf("72227\n");return 0;}
else if(x>72221){printf("72223\n");return 0;}
else if(x>72211){printf("72221\n");return 0;}
else if(x>72173){printf("72211\n");return 0;}
else if(x>72169){printf("72173\n");return 0;}
else if(x>72167){printf("72169\n");return 0;}
else if(x>72161){printf("72167\n");return 0;}
else if(x>72139){printf("72161\n");return 0;}
else if(x>72109){printf("72139\n");return 0;}
else if(x>72103){printf("72109\n");return 0;}
else if(x>72101){printf("72103\n");return 0;}
else if(x>72091){printf("72101\n");return 0;}
else if(x>72089){printf("72091\n");return 0;}
else if(x>72077){printf("72089\n");return 0;}
else if(x>72073){printf("72077\n");return 0;}
else if(x>72053){printf("72073\n");return 0;}
else if(x>72047){printf("72053\n");return 0;}
else if(x>72043){printf("72047\n");return 0;}
else if(x>72031){printf("72043\n");return 0;}
else if(x>72019){printf("72031\n");return 0;}
else if(x>71999){printf("72019\n");return 0;}
else if(x>71993){printf("71999\n");return 0;}
else if(x>71987){printf("71993\n");return 0;}
else if(x>71983){printf("71987\n");return 0;}
else if(x>71971){printf("71983\n");return 0;}
else if(x>71963){printf("71971\n");return 0;}
else if(x>71947){printf("71963\n");return 0;}
else if(x>71941){printf("71947\n");return 0;}
else if(x>71933){printf("71941\n");return 0;}
else if(x>71917){printf("71933\n");return 0;}
else if(x>71909){printf("71917\n");return 0;}
else if(x>71899){printf("71909\n");return 0;}
else if(x>71887){printf("71899\n");return 0;}
else if(x>71881){printf("71887\n");return 0;}
else if(x>71879){printf("71881\n");return 0;}
else if(x>71867){printf("71879\n");return 0;}
else if(x>71861){printf("71867\n");return 0;}
else if(x>71849){printf("71861\n");return 0;}
else if(x>71843){printf("71849\n");return 0;}
else if(x>71837){printf("71843\n");return 0;}
else if(x>71821){printf("71837\n");return 0;}
else if(x>71809){printf("71821\n");return 0;}
else if(x>71807){printf("71809\n");return 0;}
else if(x>71789){printf("71807\n");return 0;}
else if(x>71777){printf("71789\n");return 0;}
else if(x>71761){printf("71777\n");return 0;}
else if(x>71741){printf("71761\n");return 0;}
else if(x>71719){printf("71741\n");return 0;}
else if(x>71713){printf("71719\n");return 0;}
else if(x>71711){printf("71713\n");return 0;}
else if(x>71707){printf("71711\n");return 0;}
else if(x>71699){printf("71707\n");return 0;}
else if(x>71693){printf("71699\n");return 0;}
else if(x>71671){printf("71693\n");return 0;}
else if(x>71663){printf("71671\n");return 0;}
else if(x>71647){printf("71663\n");return 0;}
else if(x>71633){printf("71647\n");return 0;}
else if(x>71597){printf("71633\n");return 0;}
else if(x>71593){printf("71597\n");return 0;}
else if(x>71569){printf("71593\n");return 0;}
else if(x>71563){printf("71569\n");return 0;}
else if(x>71551){printf("71563\n");return 0;}
else if(x>71549){printf("71551\n");return 0;}
else if(x>71537){printf("71549\n");return 0;}
else if(x>71527){printf("71537\n");return 0;}
else if(x>71503){printf("71527\n");return 0;}
else if(x>71483){printf("71503\n");return 0;}
else if(x>71479){printf("71483\n");return 0;}
else if(x>71473){printf("71479\n");return 0;}
else if(x>71471){printf("71473\n");return 0;}
else if(x>71453){printf("71471\n");return 0;}
else if(x>71443){printf("71453\n");return 0;}
else if(x>71437){printf("71443\n");return 0;}
else if(x>71429){printf("71437\n");return 0;}
else if(x>71419){printf("71429\n");return 0;}
else if(x>71413){printf("71419\n");return 0;}
else if(x>71411){printf("71413\n");return 0;}
else if(x>71399){printf("71411\n");return 0;}
else if(x>71389){printf("71399\n");return 0;}
else if(x>71387){printf("71389\n");return 0;}
else if(x>71363){printf("71387\n");return 0;}
else if(x>71359){printf("71363\n");return 0;}
else if(x>71353){printf("71359\n");return 0;}
else if(x>71347){printf("71353\n");return 0;}
else if(x>71341){printf("71347\n");return 0;}
else if(x>71339){printf("71341\n");return 0;}
else if(x>71333){printf("71339\n");return 0;}
else if(x>71329){printf("71333\n");return 0;}
else if(x>71327){printf("71329\n");return 0;}
else if(x>71317){printf("71327\n");return 0;}
else if(x>71293){printf("71317\n");return 0;}
else if(x>71287){printf("71293\n");return 0;}
else if(x>71263){printf("71287\n");return 0;}
else if(x>71261){printf("71263\n");return 0;}
else if(x>71257){printf("71261\n");return 0;}
else if(x>71249){printf("71257\n");return 0;}
else if(x>71237){printf("71249\n");return 0;}
else if(x>71233){printf("71237\n");return 0;}
else if(x>71209){printf("71233\n");return 0;}
else if(x>71191){printf("71209\n");return 0;}
else if(x>71171){printf("71191\n");return 0;}
else if(x>71167){printf("71171\n");return 0;}
else if(x>71161){printf("71167\n");return 0;}
else if(x>71153){printf("71161\n");return 0;}
else if(x>71147){printf("71153\n");return 0;}
else if(x>71143){printf("71147\n");return 0;}
else if(x>71129){printf("71143\n");return 0;}
else if(x>71119){printf("71129\n");return 0;}
else if(x>71089){printf("71119\n");return 0;}
else if(x>71081){printf("71089\n");return 0;}
else if(x>71069){printf("71081\n");return 0;}
else if(x>71059){printf("71069\n");return 0;}
else if(x>71039){printf("71059\n");return 0;}
else if(x>71023){printf("71039\n");return 0;}
else if(x>71011){printf("71023\n");return 0;}
else if(x>70999){printf("71011\n");return 0;}
else if(x>70997){printf("70999\n");return 0;}
else if(x>70991){printf("70997\n");return 0;}
else if(x>70981){printf("70991\n");return 0;}
else if(x>70979){printf("70981\n");return 0;}
else if(x>70969){printf("70979\n");return 0;}
else if(x>70957){printf("70969\n");return 0;}
else if(x>70951){printf("70957\n");return 0;}
else if(x>70949){printf("70951\n");return 0;}
else if(x>70937){printf("70949\n");return 0;}
else if(x>70921){printf("70937\n");return 0;}
else if(x>70919){printf("70921\n");return 0;}
else if(x>70913){printf("70919\n");return 0;}
else if(x>70901){printf("70913\n");return 0;}
else if(x>70891){printf("70901\n");return 0;}
else if(x>70879){printf("70891\n");return 0;}
else if(x>70877){printf("70879\n");return 0;}
else if(x>70867){printf("70877\n");return 0;}
else if(x>70853){printf("70867\n");return 0;}
else if(x>70849){printf("70853\n");return 0;}
else if(x>70843){printf("70849\n");return 0;}
else if(x>70841){printf("70843\n");return 0;}
else if(x>70823){printf("70841\n");return 0;}
else if(x>70793){printf("70823\n");return 0;}
else if(x>70783){printf("70793\n");return 0;}
else if(x>70769){printf("70783\n");return 0;}
else if(x>70753){printf("70769\n");return 0;}
else if(x>70729){printf("70753\n");return 0;}
else if(x>70717){printf("70729\n");return 0;}
else if(x>70709){printf("70717\n");return 0;}
else if(x>70687){printf("70709\n");return 0;}
else if(x>70667){printf("70687\n");return 0;}
else if(x>70663){printf("70667\n");return 0;}
else if(x>70657){printf("70663\n");return 0;}
else if(x>70639){printf("70657\n");return 0;}
else if(x>70627){printf("70639\n");return 0;}
else if(x>70621){printf("70627\n");return 0;}
else if(x>70619){printf("70621\n");return 0;}
else if(x>70607){printf("70619\n");return 0;}
else if(x>70589){printf("70607\n");return 0;}
else if(x>70583){printf("70589\n");return 0;}
else if(x>70573){printf("70583\n");return 0;}
else if(x>70571){printf("70573\n");return 0;}
else if(x>70549){printf("70571\n");return 0;}
else if(x>70537){printf("70549\n");return 0;}
else if(x>70529){printf("70537\n");return 0;}
else if(x>70507){printf("70529\n");return 0;}
else if(x>70501){printf("70507\n");return 0;}
else if(x>70489){printf("70501\n");return 0;}
else if(x>70487){printf("70489\n");return 0;}
else if(x>70481){printf("70487\n");return 0;}
else if(x>70459){printf("70481\n");return 0;}
else if(x>70457){printf("70459\n");return 0;}
else if(x>70451){printf("70457\n");return 0;}
else if(x>70439){printf("70451\n");return 0;}
else if(x>70429){printf("70439\n");return 0;}
else if(x>70423){printf("70429\n");return 0;}
else if(x>70393){printf("70423\n");return 0;}
else if(x>70381){printf("70393\n");return 0;}
else if(x>70379){printf("70381\n");return 0;}
else if(x>70373){printf("70379\n");return 0;}
else if(x>70351){printf("70373\n");return 0;}
else if(x>70327){printf("70351\n");return 0;}
else if(x>70321){printf("70327\n");return 0;}
else if(x>70313){printf("70321\n");return 0;}
else if(x>70309){printf("70313\n");return 0;}
else if(x>70297){printf("70309\n");return 0;}
else if(x>70289){printf("70297\n");return 0;}
else if(x>70271){printf("70289\n");return 0;}
else if(x>70249){printf("70271\n");return 0;}
else if(x>70241){printf("70249\n");return 0;}
else if(x>70237){printf("70241\n");return 0;}
else if(x>70229){printf("70237\n");return 0;}
else if(x>70223){printf("70229\n");return 0;}
else if(x>70207){printf("70223\n");return 0;}
else if(x>70201){printf("70207\n");return 0;}
else if(x>70199){printf("70201\n");return 0;}
else if(x>70183){printf("70199\n");return 0;}
else if(x>70181){printf("70183\n");return 0;}
else if(x>70177){printf("70181\n");return 0;}
else if(x>70163){printf("70177\n");return 0;}
else if(x>70157){printf("70163\n");return 0;}
else if(x>70141){printf("70157\n");return 0;}
else if(x>70139){printf("70141\n");return 0;}
else if(x>70123){printf("70139\n");return 0;}
else if(x>70121){printf("70123\n");return 0;}
else if(x>70117){printf("70121\n");return 0;}
else if(x>70111){printf("70117\n");return 0;}
else if(x>70099){printf("70111\n");return 0;}
else if(x>70079){printf("70099\n");return 0;}
else if(x>70067){printf("70079\n");return 0;}
else if(x>70061){printf("70067\n");return 0;}
else if(x>70051){printf("70061\n");return 0;}
else if(x>70039){printf("70051\n");return 0;}
else if(x>70019){printf("70039\n");return 0;}
else if(x>70009){printf("70019\n");return 0;}
else if(x>70003){printf("70009\n");return 0;}
else if(x>70001){printf("70003\n");return 0;}
else if(x>69997){printf("70001\n");return 0;}
else if(x>69991){printf("69997\n");return 0;}
else if(x>69959){printf("69991\n");return 0;}
else if(x>69941){printf("69959\n");return 0;}
else if(x>69931){printf("69941\n");return 0;}
else if(x>69929){printf("69931\n");return 0;}
else if(x>69911){printf("69929\n");return 0;}
else if(x>69899){printf("69911\n");return 0;}
else if(x>69877){printf("69899\n");return 0;}
else if(x>69859){printf("69877\n");return 0;}
else if(x>69857){printf("69859\n");return 0;}
else if(x>69847){printf("69857\n");return 0;}
else if(x>69833){printf("69847\n");return 0;}
else if(x>69829){printf("69833\n");return 0;}
else if(x>69827){printf("69829\n");return 0;}
else if(x>69821){printf("69827\n");return 0;}
else if(x>69809){printf("69821\n");return 0;}
else if(x>69779){printf("69809\n");return 0;}
else if(x>69767){printf("69779\n");return 0;}
else if(x>69763){printf("69767\n");return 0;}
else if(x>69761){printf("69763\n");return 0;}
else if(x>69739){printf("69761\n");return 0;}
else if(x>69737){printf("69739\n");return 0;}
else if(x>69709){printf("69737\n");return 0;}
else if(x>69697){printf("69709\n");return 0;}
else if(x>69691){printf("69697\n");return 0;}
else if(x>69677){printf("69691\n");return 0;}
else if(x>69661){printf("69677\n");return 0;}
else if(x>69653){printf("69661\n");return 0;}
else if(x>69623){printf("69653\n");return 0;}
else if(x>69593){printf("69623\n");return 0;}
else if(x>69557){printf("69593\n");return 0;}
else if(x>69539){printf("69557\n");return 0;}
else if(x>69499){printf("69539\n");return 0;}
else if(x>69497){printf("69499\n");return 0;}
else if(x>69493){printf("69497\n");return 0;}
else if(x>69491){printf("69493\n");return 0;}
else if(x>69481){printf("69491\n");return 0;}
else if(x>69473){printf("69481\n");return 0;}
else if(x>69467){printf("69473\n");return 0;}
else if(x>69463){printf("69467\n");return 0;}
else if(x>69457){printf("69463\n");return 0;}
else if(x>69439){printf("69457\n");return 0;}
else if(x>69431){printf("69439\n");return 0;}
else if(x>69427){printf("69431\n");return 0;}
else if(x>69403){printf("69427\n");return 0;}
else if(x>69401){printf("69403\n");return 0;}
else if(x>69389){printf("69401\n");return 0;}
else if(x>69383){printf("69389\n");return 0;}
else if(x>69379){printf("69383\n");return 0;}
else if(x>69371){printf("69379\n");return 0;}
else if(x>69341){printf("69371\n");return 0;}
else if(x>69337){printf("69341\n");return 0;}
else if(x>69317){printf("69337\n");return 0;}
else if(x>69313){printf("69317\n");return 0;}
else if(x>69263){printf("69313\n");return 0;}
else if(x>69259){printf("69263\n");return 0;}
else if(x>69257){printf("69259\n");return 0;}
else if(x>69247){printf("69257\n");return 0;}
else if(x>69239){printf("69247\n");return 0;}
else if(x>69233){printf("69239\n");return 0;}
else if(x>69221){printf("69233\n");return 0;}
else if(x>69203){printf("69221\n");return 0;}
else if(x>69197){printf("69203\n");return 0;}
else if(x>69193){printf("69197\n");return 0;}
else if(x>69191){printf("69193\n");return 0;}
else if(x>69163){printf("69191\n");return 0;}
else if(x>69151){printf("69163\n");return 0;}
else if(x>69149){printf("69151\n");return 0;}
else if(x>69143){printf("69149\n");return 0;}
else if(x>69127){printf("69143\n");return 0;}
else if(x>69119){printf("69127\n");return 0;}
else if(x>69109){printf("69119\n");return 0;}
else if(x>69073){printf("69109\n");return 0;}
else if(x>69067){printf("69073\n");return 0;}
else if(x>69061){printf("69067\n");return 0;}
else if(x>69031){printf("69061\n");return 0;}
else if(x>69029){printf("69031\n");return 0;}
else if(x>69019){printf("69029\n");return 0;}
else if(x>69011){printf("69019\n");return 0;}
else if(x>69001){printf("69011\n");return 0;}
else if(x>68993){printf("69001\n");return 0;}
else if(x>68963){printf("68993\n");return 0;}
else if(x>68947){printf("68963\n");return 0;}
else if(x>68927){printf("68947\n");return 0;}
else if(x>68917){printf("68927\n");return 0;}
else if(x>68909){printf("68917\n");return 0;}
else if(x>68903){printf("68909\n");return 0;}
else if(x>68899){printf("68903\n");return 0;}
else if(x>68897){printf("68899\n");return 0;}
else if(x>68891){printf("68897\n");return 0;}
else if(x>68881){printf("68891\n");return 0;}
else if(x>68879){printf("68881\n");return 0;}
else if(x>68863){printf("68879\n");return 0;}
else if(x>68821){printf("68863\n");return 0;}
else if(x>68819){printf("68821\n");return 0;}
else if(x>68813){printf("68819\n");return 0;}
else if(x>68791){printf("68813\n");return 0;}
else if(x>68777){printf("68791\n");return 0;}
else if(x>68771){printf("68777\n");return 0;}
else if(x>68767){printf("68771\n");return 0;}
else if(x>68749){printf("68767\n");return 0;}
else if(x>68743){printf("68749\n");return 0;}
else if(x>68737){printf("68743\n");return 0;}
else if(x>68729){printf("68737\n");return 0;}
else if(x>68713){printf("68729\n");return 0;}
else if(x>68711){printf("68713\n");return 0;}
else if(x>68699){printf("68711\n");return 0;}
else if(x>68687){printf("68699\n");return 0;}
else if(x>68683){printf("68687\n");return 0;}
else if(x>68669){printf("68683\n");return 0;}
else if(x>68659){printf("68669\n");return 0;}
else if(x>68639){printf("68659\n");return 0;}
else if(x>68633){printf("68639\n");return 0;}
else if(x>68611){printf("68633\n");return 0;}
else if(x>68597){printf("68611\n");return 0;}
else if(x>68581){printf("68597\n");return 0;}
else if(x>68567){printf("68581\n");return 0;}
else if(x>68543){printf("68567\n");return 0;}
else if(x>68539){printf("68543\n");return 0;}
else if(x>68531){printf("68539\n");return 0;}
else if(x>68521){printf("68531\n");return 0;}
else if(x>68507){printf("68521\n");return 0;}
else if(x>68501){printf("68507\n");return 0;}
else if(x>68491){printf("68501\n");return 0;}
else if(x>68489){printf("68491\n");return 0;}
else if(x>68483){printf("68489\n");return 0;}
else if(x>68477){printf("68483\n");return 0;}
else if(x>68473){printf("68477\n");return 0;}
else if(x>68449){printf("68473\n");return 0;}
else if(x>68447){printf("68449\n");return 0;}
else if(x>68443){printf("68447\n");return 0;}
else if(x>68437){printf("68443\n");return 0;}
else if(x>68399){printf("68437\n");return 0;}
else if(x>68389){printf("68399\n");return 0;}
else if(x>68371){printf("68389\n");return 0;}
else if(x>68351){printf("68371\n");return 0;}
else if(x>68329){printf("68351\n");return 0;}
else if(x>68311){printf("68329\n");return 0;}
else if(x>68281){printf("68311\n");return 0;}
else if(x>68279){printf("68281\n");return 0;}
else if(x>68261){printf("68279\n");return 0;}
else if(x>68239){printf("68261\n");return 0;}
else if(x>68227){printf("68239\n");return 0;}
else if(x>68219){printf("68227\n");return 0;}
else if(x>68213){printf("68219\n");return 0;}
else if(x>68209){printf("68213\n");return 0;}
else if(x>68207){printf("68209\n");return 0;}
else if(x>68171){printf("68207\n");return 0;}
else if(x>68161){printf("68171\n");return 0;}
else if(x>68147){printf("68161\n");return 0;}
else if(x>68141){printf("68147\n");return 0;}
else if(x>68113){printf("68141\n");return 0;}
else if(x>68111){printf("68113\n");return 0;}
else if(x>68099){printf("68111\n");return 0;}
else if(x>68087){printf("68099\n");return 0;}
else if(x>68071){printf("68087\n");return 0;}
else if(x>68059){printf("68071\n");return 0;}
else if(x>68053){printf("68059\n");return 0;}
else if(x>68041){printf("68053\n");return 0;}
else if(x>68023){printf("68041\n");return 0;}
else if(x>67993){printf("68023\n");return 0;}
else if(x>67987){printf("67993\n");return 0;}
else if(x>67979){printf("67987\n");return 0;}
else if(x>67967){printf("67979\n");return 0;}
else if(x>67961){printf("67967\n");return 0;}
else if(x>67957){printf("67961\n");return 0;}
else if(x>67943){printf("67957\n");return 0;}
else if(x>67939){printf("67943\n");return 0;}
else if(x>67933){printf("67939\n");return 0;}
else if(x>67931){printf("67933\n");return 0;}
else if(x>67927){printf("67931\n");return 0;}
else if(x>67901){printf("67927\n");return 0;}
else if(x>67891){printf("67901\n");return 0;}
else if(x>67883){printf("67891\n");return 0;}
else if(x>67867){printf("67883\n");return 0;}
else if(x>67853){printf("67867\n");return 0;}
else if(x>67843){printf("67853\n");return 0;}
else if(x>67829){printf("67843\n");return 0;}
else if(x>67819){printf("67829\n");return 0;}
else if(x>67807){printf("67819\n");return 0;}
else if(x>67801){printf("67807\n");return 0;}
else if(x>67789){printf("67801\n");return 0;}
else if(x>67783){printf("67789\n");return 0;}
else if(x>67777){printf("67783\n");return 0;}
else if(x>67763){printf("67777\n");return 0;}
else if(x>67759){printf("67763\n");return 0;}
else if(x>67757){printf("67759\n");return 0;}
else if(x>67751){printf("67757\n");return 0;}
else if(x>67741){printf("67751\n");return 0;}
else if(x>67733){printf("67741\n");return 0;}
else if(x>67723){printf("67733\n");return 0;}
else if(x>67709){printf("67723\n");return 0;}
else if(x>67699){printf("67709\n");return 0;}
else if(x>67679){printf("67699\n");return 0;}
else if(x>67651){printf("67679\n");return 0;}
else if(x>67631){printf("67651\n");return 0;}
else if(x>67619){printf("67631\n");return 0;}
else if(x>67607){printf("67619\n");return 0;}
else if(x>67601){printf("67607\n");return 0;}
else if(x>67589){printf("67601\n");return 0;}
else if(x>67579){printf("67589\n");return 0;}
else if(x>67577){printf("67579\n");return 0;}
else if(x>67567){printf("67577\n");return 0;}
else if(x>67559){printf("67567\n");return 0;}
else if(x>67547){printf("67559\n");return 0;}
else if(x>67537){printf("67547\n");return 0;}
else if(x>67531){printf("67537\n");return 0;}
else if(x>67523){printf("67531\n");return 0;}
else if(x>67511){printf("67523\n");return 0;}
else if(x>67499){printf("67511\n");return 0;}
else if(x>67493){printf("67499\n");return 0;}
else if(x>67489){printf("67493\n");return 0;}
else if(x>67481){printf("67489\n");return 0;}
else if(x>67477){printf("67481\n");return 0;}
else if(x>67453){printf("67477\n");return 0;}
else if(x>67447){printf("67453\n");return 0;}
else if(x>67433){printf("67447\n");return 0;}
else if(x>67429){printf("67433\n");return 0;}
else if(x>67427){printf("67429\n");return 0;}
else if(x>67421){printf("67427\n");return 0;}
else if(x>67411){printf("67421\n");return 0;}
else if(x>67409){printf("67411\n");return 0;}
else if(x>67399){printf("67409\n");return 0;}
else if(x>67391){printf("67399\n");return 0;}
else if(x>67369){printf("67391\n");return 0;}
else if(x>67349){printf("67369\n");return 0;}
else if(x>67343){printf("67349\n");return 0;}
else if(x>67339){printf("67343\n");return 0;}
else if(x>67307){printf("67339\n");return 0;}
else if(x>67289){printf("67307\n");return 0;}
else if(x>67273){printf("67289\n");return 0;}
else if(x>67271){printf("67273\n");return 0;}
else if(x>67261){printf("67271\n");return 0;}
else if(x>67247){printf("67261\n");return 0;}
else if(x>67231){printf("67247\n");return 0;}
else if(x>67219){printf("67231\n");return 0;}
else if(x>67217){printf("67219\n");return 0;}
else if(x>67213){printf("67217\n");return 0;}
else if(x>67211){printf("67213\n");return 0;}
else if(x>67189){printf("67211\n");return 0;}
else if(x>67187){printf("67189\n");return 0;}
else if(x>67181){printf("67187\n");return 0;}
else if(x>67169){printf("67181\n");return 0;}
else if(x>67157){printf("67169\n");return 0;}
else if(x>67153){printf("67157\n");return 0;}
else if(x>67141){printf("67153\n");return 0;}
else if(x>67139){printf("67141\n");return 0;}
else if(x>67129){printf("67139\n");return 0;}
else if(x>67121){printf("67129\n");return 0;}
else if(x>67103){printf("67121\n");return 0;}
else if(x>67079){printf("67103\n");return 0;}
else if(x>67073){printf("67079\n");return 0;}
else if(x>67061){printf("67073\n");return 0;}
else if(x>67057){printf("67061\n");return 0;}
else if(x>67049){printf("67057\n");return 0;}
else if(x>67043){printf("67049\n");return 0;}
else if(x>67033){printf("67043\n");return 0;}
else if(x>67021){printf("67033\n");return 0;}
else if(x>67003){printf("67021\n");return 0;}
else if(x>66977){printf("67003\n");return 0;}
else if(x>66973){printf("66977\n");return 0;}
else if(x>66959){printf("66973\n");return 0;}
else if(x>66949){printf("66959\n");return 0;}
else if(x>66947){printf("66949\n");return 0;}
else if(x>66943){printf("66947\n");return 0;}
else if(x>66931){printf("66943\n");return 0;}
else if(x>66923){printf("66931\n");return 0;}
else if(x>66919){printf("66923\n");return 0;}
else if(x>66889){printf("66919\n");return 0;}
else if(x>66883){printf("66889\n");return 0;}
else if(x>66877){printf("66883\n");return 0;}
else if(x>66863){printf("66877\n");return 0;}
else if(x>66853){printf("66863\n");return 0;}
else if(x>66851){printf("66853\n");return 0;}
else if(x>66841){printf("66851\n");return 0;}
else if(x>66821){printf("66841\n");return 0;}
else if(x>66809){printf("66821\n");return 0;}
else if(x>66797){printf("66809\n");return 0;}
else if(x>66791){printf("66797\n");return 0;}
else if(x>66763){printf("66791\n");return 0;}
else if(x>66751){printf("66763\n");return 0;}
else if(x>66749){printf("66751\n");return 0;}
else if(x>66739){printf("66749\n");return 0;}
else if(x>66733){printf("66739\n");return 0;}
else if(x>66721){printf("66733\n");return 0;}
else if(x>66713){printf("66721\n");return 0;}
else if(x>66701){printf("66713\n");return 0;}
else if(x>66697){printf("66701\n");return 0;}
else if(x>66683){printf("66697\n");return 0;}
else if(x>66653){printf("66683\n");return 0;}
else if(x>66643){printf("66653\n");return 0;}
else if(x>66629){printf("66643\n");return 0;}
else if(x>66617){printf("66629\n");return 0;}
else if(x>66601){printf("66617\n");return 0;}
else if(x>66593){printf("66601\n");return 0;}
else if(x>66587){printf("66593\n");return 0;}
else if(x>66571){printf("66587\n");return 0;}
else if(x>66569){printf("66571\n");return 0;}
else if(x>66553){printf("66569\n");return 0;}
else if(x>66541){printf("66553\n");return 0;}
else if(x>66533){printf("66541\n");return 0;}
else if(x>66529){printf("66533\n");return 0;}
else if(x>66523){printf("66529\n");return 0;}
else if(x>66509){printf("66523\n");return 0;}
else if(x>66499){printf("66509\n");return 0;}
else if(x>66491){printf("66499\n");return 0;}
else if(x>66467){printf("66491\n");return 0;}
else if(x>66463){printf("66467\n");return 0;}
else if(x>66457){printf("66463\n");return 0;}
else if(x>66449){printf("66457\n");return 0;}
else if(x>66431){printf("66449\n");return 0;}
else if(x>66413){printf("66431\n");return 0;}
else if(x>66403){printf("66413\n");return 0;}
else if(x>66383){printf("66403\n");return 0;}
else if(x>66377){printf("66383\n");return 0;}
else if(x>66373){printf("66377\n");return 0;}
else if(x>66361){printf("66373\n");return 0;}
else if(x>66359){printf("66361\n");return 0;}
else if(x>66347){printf("66359\n");return 0;}
else if(x>66343){printf("66347\n");return 0;}
else if(x>66337){printf("66343\n");return 0;}
else if(x>66301){printf("66337\n");return 0;}
else if(x>66293){printf("66301\n");return 0;}
else if(x>66271){printf("66293\n");return 0;}
else if(x>66239){printf("66271\n");return 0;}
else if(x>66221){printf("66239\n");return 0;}
else if(x>66191){printf("66221\n");return 0;}
else if(x>66179){printf("66191\n");return 0;}
else if(x>66173){printf("66179\n");return 0;}
else if(x>66169){printf("66173\n");return 0;}
else if(x>66161){printf("66169\n");return 0;}
else if(x>66137){printf("66161\n");return 0;}
else if(x>66109){printf("66137\n");return 0;}
else if(x>66107){printf("66109\n");return 0;}
else if(x>66103){printf("66107\n");return 0;}
else if(x>66089){printf("66103\n");return 0;}
else if(x>66083){printf("66089\n");return 0;}
else if(x>66071){printf("66083\n");return 0;}
else if(x>66067){printf("66071\n");return 0;}
else if(x>66047){printf("66067\n");return 0;}
else if(x>66041){printf("66047\n");return 0;}
else if(x>66037){printf("66041\n");return 0;}
else if(x>66029){printf("66037\n");return 0;}
else if(x>65993){printf("66029\n");return 0;}
else if(x>65983){printf("65993\n");return 0;}
else if(x>65981){printf("65983\n");return 0;}
else if(x>65963){printf("65981\n");return 0;}
else if(x>65957){printf("65963\n");return 0;}
else if(x>65951){printf("65957\n");return 0;}
else if(x>65929){printf("65951\n");return 0;}
else if(x>65927){printf("65929\n");return 0;}
else if(x>65921){printf("65927\n");return 0;}
else if(x>65899){printf("65921\n");return 0;}
else if(x>65881){printf("65899\n");return 0;}
else if(x>65867){printf("65881\n");return 0;}
else if(x>65851){printf("65867\n");return 0;}
else if(x>65843){printf("65851\n");return 0;}
else if(x>65839){printf("65843\n");return 0;}
else if(x>65837){printf("65839\n");return 0;}
else if(x>65831){printf("65837\n");return 0;}
else if(x>65827){printf("65831\n");return 0;}
else if(x>65809){printf("65827\n");return 0;}
else if(x>65789){printf("65809\n");return 0;}
else if(x>65777){printf("65789\n");return 0;}
else if(x>65761){printf("65777\n");return 0;}
else if(x>65731){printf("65761\n");return 0;}
else if(x>65729){printf("65731\n");return 0;}
else if(x>65719){printf("65729\n");return 0;}
else if(x>65717){printf("65719\n");return 0;}
else if(x>65713){printf("65717\n");return 0;}
else if(x>65707){printf("65713\n");return 0;}
else if(x>65701){printf("65707\n");return 0;}
else if(x>65699){printf("65701\n");return 0;}
else if(x>65687){printf("65699\n");return 0;}
else if(x>65677){printf("65687\n");return 0;}
else if(x>65657){printf("65677\n");return 0;}
else if(x>65651){printf("65657\n");return 0;}
else if(x>65647){printf("65651\n");return 0;}
else if(x>65633){printf("65647\n");return 0;}
else if(x>65629){printf("65633\n");return 0;}
else if(x>65617){printf("65629\n");return 0;}
else if(x>65609){printf("65617\n");return 0;}
else if(x>65599){printf("65609\n");return 0;}
else if(x>65587){printf("65599\n");return 0;}
else if(x>65581){printf("65587\n");return 0;}
else if(x>65579){printf("65581\n");return 0;}
else if(x>65563){printf("65579\n");return 0;}
else if(x>65557){printf("65563\n");return 0;}
else if(x>65551){printf("65557\n");return 0;}
else if(x>65543){printf("65551\n");return 0;}
else if(x>65539){printf("65543\n");return 0;}
else if(x>65537){printf("65539\n");return 0;}
else if(x>65521){printf("65537\n");return 0;}
else if(x>65519){printf("65521\n");return 0;}
else if(x>65497){printf("65519\n");return 0;}
else if(x>65479){printf("65497\n");return 0;}
else if(x>65449){printf("65479\n");return 0;}
else if(x>65447){printf("65449\n");return 0;}
else if(x>65437){printf("65447\n");return 0;}
else if(x>65423){printf("65437\n");return 0;}
else if(x>65419){printf("65423\n");return 0;}
else if(x>65413){printf("65419\n");return 0;}
else if(x>65407){printf("65413\n");return 0;}
else if(x>65393){printf("65407\n");return 0;}
else if(x>65381){printf("65393\n");return 0;}
else if(x>65371){printf("65381\n");return 0;}
else if(x>65357){printf("65371\n");return 0;}
else if(x>65353){printf("65357\n");return 0;}
else if(x>65327){printf("65353\n");return 0;}
else if(x>65323){printf("65327\n");return 0;}
else if(x>65309){printf("65323\n");return 0;}
else if(x>65293){printf("65309\n");return 0;}
else if(x>65287){printf("65293\n");return 0;}
else if(x>65269){printf("65287\n");return 0;}
else if(x>65267){printf("65269\n");return 0;}
else if(x>65257){printf("65267\n");return 0;}
else if(x>65239){printf("65257\n");return 0;}
else if(x>65213){printf("65239\n");return 0;}
else if(x>65203){printf("65213\n");return 0;}
else if(x>65183){printf("65203\n");return 0;}
else if(x>65179){printf("65183\n");return 0;}
else if(x>65173){printf("65179\n");return 0;}
else if(x>65171){printf("65173\n");return 0;}
else if(x>65167){printf("65171\n");return 0;}
else if(x>65147){printf("65167\n");return 0;}
else if(x>65141){printf("65147\n");return 0;}
else if(x>65129){printf("65141\n");return 0;}
else if(x>65123){printf("65129\n");return 0;}
else if(x>65119){printf("65123\n");return 0;}
else if(x>65111){printf("65119\n");return 0;}
else if(x>65101){printf("65111\n");return 0;}
else if(x>65099){printf("65101\n");return 0;}
else if(x>65089){printf("65099\n");return 0;}
else if(x>65071){printf("65089\n");return 0;}
else if(x>65063){printf("65071\n");return 0;}
else if(x>65053){printf("65063\n");return 0;}
else if(x>65033){printf("65053\n");return 0;}
else if(x>65029){printf("65033\n");return 0;}
else if(x>65027){printf("65029\n");return 0;}
else if(x>65011){printf("65027\n");return 0;}
else if(x>65003){printf("65011\n");return 0;}
else if(x>64997){printf("65003\n");return 0;}
else if(x>64969){printf("64997\n");return 0;}
else if(x>64951){printf("64969\n");return 0;}
else if(x>64937){printf("64951\n");return 0;}
else if(x>64927){printf("64937\n");return 0;}
else if(x>64921){printf("64927\n");return 0;}
else if(x>64919){printf("64921\n");return 0;}
else if(x>64901){printf("64919\n");return 0;}
else if(x>64891){printf("64901\n");return 0;}
else if(x>64879){printf("64891\n");return 0;}
else if(x>64877){printf("64879\n");return 0;}
else if(x>64871){printf("64877\n");return 0;}
else if(x>64853){printf("64871\n");return 0;}
else if(x>64849){printf("64853\n");return 0;}
else if(x>64817){printf("64849\n");return 0;}
else if(x>64811){printf("64817\n");return 0;}
else if(x>64793){printf("64811\n");return 0;}
else if(x>64783){printf("64793\n");return 0;}
else if(x>64781){printf("64783\n");return 0;}
else if(x>64763){printf("64781\n");return 0;}
else if(x>64747){printf("64763\n");return 0;}
else if(x>64717){printf("64747\n");return 0;}
else if(x>64709){printf("64717\n");return 0;}
else if(x>64693){printf("64709\n");return 0;}
else if(x>64679){printf("64693\n");return 0;}
else if(x>64667){printf("64679\n");return 0;}
else if(x>64663){printf("64667\n");return 0;}
else if(x>64661){printf("64663\n");return 0;}
else if(x>64633){printf("64661\n");return 0;}
else if(x>64627){printf("64633\n");return 0;}
else if(x>64621){printf("64627\n");return 0;}
else if(x>64613){printf("64621\n");return 0;}
else if(x>64609){printf("64613\n");return 0;}
else if(x>64601){printf("64609\n");return 0;}
else if(x>64591){printf("64601\n");return 0;}
else if(x>64579){printf("64591\n");return 0;}
else if(x>64577){printf("64579\n");return 0;}
else if(x>64567){printf("64577\n");return 0;}
else if(x>64553){printf("64567\n");return 0;}
else if(x>64513){printf("64553\n");return 0;}
else if(x>64499){printf("64513\n");return 0;}
else if(x>64489){printf("64499\n");return 0;}
else if(x>64483){printf("64489\n");return 0;}
else if(x>64453){printf("64483\n");return 0;}
else if(x>64451){printf("64453\n");return 0;}
else if(x>64439){printf("64451\n");return 0;}
else if(x>64433){printf("64439\n");return 0;}
else if(x>64403){printf("64433\n");return 0;}
else if(x>64399){printf("64403\n");return 0;}
else if(x>64381){printf("64399\n");return 0;}
else if(x>64373){printf("64381\n");return 0;}
else if(x>64333){printf("64373\n");return 0;}
else if(x>64327){printf("64333\n");return 0;}
else if(x>64319){printf("64327\n");return 0;}
else if(x>64303){printf("64319\n");return 0;}
else if(x>64301){printf("64303\n");return 0;}
else if(x>64283){printf("64301\n");return 0;}
else if(x>64279){printf("64283\n");return 0;}
else if(x>64271){printf("64279\n");return 0;}
else if(x>64237){printf("64271\n");return 0;}
else if(x>64231){printf("64237\n");return 0;}
else if(x>64223){printf("64231\n");return 0;}
else if(x>64217){printf("64223\n");return 0;}
else if(x>64189){printf("64217\n");return 0;}
else if(x>64187){printf("64189\n");return 0;}
else if(x>64171){printf("64187\n");return 0;}
else if(x>64157){printf("64171\n");return 0;}
else if(x>64153){printf("64157\n");return 0;}
else if(x>64151){printf("64153\n");return 0;}
else if(x>64123){printf("64151\n");return 0;}
else if(x>64109){printf("64123\n");return 0;}
else if(x>64091){printf("64109\n");return 0;}
else if(x>64081){printf("64091\n");return 0;}
else if(x>64067){printf("64081\n");return 0;}
else if(x>64063){printf("64067\n");return 0;}
else if(x>64037){printf("64063\n");return 0;}
else if(x>64033){printf("64037\n");return 0;}
else if(x>64019){printf("64033\n");return 0;}
else if(x>64013){printf("64019\n");return 0;}
else if(x>64007){printf("64013\n");return 0;}
else if(x>63997){printf("64007\n");return 0;}
else if(x>63977){printf("63997\n");return 0;}
else if(x>63949){printf("63977\n");return 0;}
else if(x>63929){printf("63949\n");return 0;}
else if(x>63913){printf("63929\n");return 0;}
else if(x>63907){printf("63913\n");return 0;}
else if(x>63901){printf("63907\n");return 0;}
else if(x>63863){printf("63901\n");return 0;}
else if(x>63857){printf("63863\n");return 0;}
else if(x>63853){printf("63857\n");return 0;}
else if(x>63841){printf("63853\n");return 0;}
else if(x>63839){printf("63841\n");return 0;}
else if(x>63823){printf("63839\n");return 0;}
else if(x>63809){printf("63823\n");return 0;}
else if(x>63803){printf("63809\n");return 0;}
else if(x>63799){printf("63803\n");return 0;}
else if(x>63793){printf("63799\n");return 0;}
else if(x>63781){printf("63793\n");return 0;}
else if(x>63773){printf("63781\n");return 0;}
else if(x>63761){printf("63773\n");return 0;}
else if(x>63743){printf("63761\n");return 0;}
else if(x>63737){printf("63743\n");return 0;}
else if(x>63727){printf("63737\n");return 0;}
else if(x>63719){printf("63727\n");return 0;}
else if(x>63709){printf("63719\n");return 0;}
else if(x>63703){printf("63709\n");return 0;}
else if(x>63697){printf("63703\n");return 0;}
else if(x>63691){printf("63697\n");return 0;}
else if(x>63689){printf("63691\n");return 0;}
else if(x>63671){printf("63689\n");return 0;}
else if(x>63667){printf("63671\n");return 0;}
else if(x>63659){printf("63667\n");return 0;}
else if(x>63649){printf("63659\n");return 0;}
else if(x>63647){printf("63649\n");return 0;}
else if(x>63629){printf("63647\n");return 0;}
else if(x>63617){printf("63629\n");return 0;}
else if(x>63611){printf("63617\n");return 0;}
else if(x>63607){printf("63611\n");return 0;}
else if(x>63601){printf("63607\n");return 0;}
else if(x>63599){printf("63601\n");return 0;}
else if(x>63589){printf("63599\n");return 0;}
else if(x>63587){printf("63589\n");return 0;}
else if(x>63577){printf("63587\n");return 0;}
else if(x>63559){printf("63577\n");return 0;}
else if(x>63541){printf("63559\n");return 0;}
else if(x>63533){printf("63541\n");return 0;}
else if(x>63527){printf("63533\n");return 0;}
else if(x>63521){printf("63527\n");return 0;}
else if(x>63499){printf("63521\n");return 0;}
else if(x>63493){printf("63499\n");return 0;}
else if(x>63487){printf("63493\n");return 0;}
else if(x>63473){printf("63487\n");return 0;}
else if(x>63467){printf("63473\n");return 0;}
else if(x>63463){printf("63467\n");return 0;}
else if(x>63443){printf("63463\n");return 0;}
else if(x>63439){printf("63443\n");return 0;}
else if(x>63421){printf("63439\n");return 0;}
else if(x>63419){printf("63421\n");return 0;}
else if(x>63409){printf("63419\n");return 0;}
else if(x>63397){printf("63409\n");return 0;}
else if(x>63391){printf("63397\n");return 0;}
else if(x>63389){printf("63391\n");return 0;}
else if(x>63377){printf("63389\n");return 0;}
else if(x>63367){printf("63377\n");return 0;}
else if(x>63361){printf("63367\n");return 0;}
else if(x>63353){printf("63361\n");return 0;}
else if(x>63347){printf("63353\n");return 0;}
else if(x>63337){printf("63347\n");return 0;}
else if(x>63331){printf("63337\n");return 0;}
else if(x>63317){printf("63331\n");return 0;}
else if(x>63313){printf("63317\n");return 0;}
else if(x>63311){printf("63313\n");return 0;}
else if(x>63299){printf("63311\n");return 0;}
else if(x>63281){printf("63299\n");return 0;}
else if(x>63277){printf("63281\n");return 0;}
else if(x>63247){printf("63277\n");return 0;}
else if(x>63241){printf("63247\n");return 0;}
else if(x>63211){printf("63241\n");return 0;}
else if(x>63199){printf("63211\n");return 0;}
else if(x>63197){printf("63199\n");return 0;}
else if(x>63179){printf("63197\n");return 0;}
else if(x>63149){printf("63179\n");return 0;}
else if(x>63131){printf("63149\n");return 0;}
else if(x>63127){printf("63131\n");return 0;}
else if(x>63113){printf("63127\n");return 0;}
else if(x>63103){printf("63113\n");return 0;}
else if(x>63097){printf("63103\n");return 0;}
else if(x>63079){printf("63097\n");return 0;}
else if(x>63073){printf("63079\n");return 0;}
else if(x>63067){printf("63073\n");return 0;}
else if(x>63059){printf("63067\n");return 0;}
else if(x>63031){printf("63059\n");return 0;}
else if(x>63029){printf("63031\n");return 0;}
else if(x>62989){printf("63029\n");return 0;}
else if(x>62987){printf("62989\n");return 0;}
else if(x>62983){printf("62987\n");return 0;}
else if(x>62981){printf("62983\n");return 0;}
else if(x>62971){printf("62981\n");return 0;}
else if(x>62969){printf("62971\n");return 0;}
else if(x>62939){printf("62969\n");return 0;}
else if(x>62929){printf("62939\n");return 0;}
else if(x>62927){printf("62929\n");return 0;}
else if(x>62921){printf("62927\n");return 0;}
else if(x>62903){printf("62921\n");return 0;}
else if(x>62897){printf("62903\n");return 0;}
else if(x>62873){printf("62897\n");return 0;}
else if(x>62869){printf("62873\n");return 0;}
else if(x>62861){printf("62869\n");return 0;}
else if(x>62851){printf("62861\n");return 0;}
else if(x>62827){printf("62851\n");return 0;}
else if(x>62819){printf("62827\n");return 0;}
else if(x>62801){printf("62819\n");return 0;}
else if(x>62791){printf("62801\n");return 0;}
else if(x>62773){printf("62791\n");return 0;}
else if(x>62761){printf("62773\n");return 0;}
else if(x>62753){printf("62761\n");return 0;}
else if(x>62743){printf("62753\n");return 0;}
else if(x>62731){printf("62743\n");return 0;}
else if(x>62723){printf("62731\n");return 0;}
else if(x>62701){printf("62723\n");return 0;}
else if(x>62687){printf("62701\n");return 0;}
else if(x>62683){printf("62687\n");return 0;}
else if(x>62659){printf("62683\n");return 0;}
else if(x>62653){printf("62659\n");return 0;}
else if(x>62639){printf("62653\n");return 0;}
else if(x>62633){printf("62639\n");return 0;}
else if(x>62627){printf("62633\n");return 0;}
else if(x>62617){printf("62627\n");return 0;}
else if(x>62603){printf("62617\n");return 0;}
else if(x>62597){printf("62603\n");return 0;}
else if(x>62591){printf("62597\n");return 0;}
else if(x>62581){printf("62591\n");return 0;}
else if(x>62563){printf("62581\n");return 0;}
else if(x>62549){printf("62563\n");return 0;}
else if(x>62539){printf("62549\n");return 0;}
else if(x>62533){printf("62539\n");return 0;}
else if(x>62507){printf("62533\n");return 0;}
else if(x>62501){printf("62507\n");return 0;}
else if(x>62497){printf("62501\n");return 0;}
else if(x>62483){printf("62497\n");return 0;}
else if(x>62477){printf("62483\n");return 0;}
else if(x>62473){printf("62477\n");return 0;}
else if(x>62467){printf("62473\n");return 0;}
else if(x>62459){printf("62467\n");return 0;}
else if(x>62423){printf("62459\n");return 0;}
else if(x>62417){printf("62423\n");return 0;}
else if(x>62401){printf("62417\n");return 0;}
else if(x>62383){printf("62401\n");return 0;}
else if(x>62351){printf("62383\n");return 0;}
else if(x>62347){printf("62351\n");return 0;}
else if(x>62327){printf("62347\n");return 0;}
else if(x>62323){printf("62327\n");return 0;}
else if(x>62311){printf("62323\n");return 0;}
else if(x>62303){printf("62311\n");return 0;}
else if(x>62299){printf("62303\n");return 0;}
else if(x>62297){printf("62299\n");return 0;}
else if(x>62273){printf("62297\n");return 0;}
else if(x>62233){printf("62273\n");return 0;}
else if(x>62219){printf("62233\n");return 0;}
else if(x>62213){printf("62219\n");return 0;}
else if(x>62207){printf("62213\n");return 0;}
else if(x>62201){printf("62207\n");return 0;}
else if(x>62191){printf("62201\n");return 0;}
else if(x>62189){printf("62191\n");return 0;}
else if(x>62171){printf("62189\n");return 0;}
else if(x>62143){printf("62171\n");return 0;}
else if(x>62141){printf("62143\n");return 0;}
else if(x>62137){printf("62141\n");return 0;}
else if(x>62131){printf("62137\n");return 0;}
else if(x>62129){printf("62131\n");return 0;}
else if(x>62119){printf("62129\n");return 0;}
else if(x>62099){printf("62119\n");return 0;}
else if(x>62081){printf("62099\n");return 0;}
else if(x>62071){printf("62081\n");return 0;}
else if(x>62057){printf("62071\n");return 0;}
else if(x>62053){printf("62057\n");return 0;}
else if(x>62047){printf("62053\n");return 0;}
else if(x>62039){printf("62047\n");return 0;}
else if(x>62017){printf("62039\n");return 0;}
else if(x>62011){printf("62017\n");return 0;}
else if(x>62003){printf("62011\n");return 0;}
else if(x>61991){printf("62003\n");return 0;}
else if(x>61987){printf("61991\n");return 0;}
else if(x>61981){printf("61987\n");return 0;}
else if(x>61979){printf("61981\n");return 0;}
else if(x>61967){printf("61979\n");return 0;}
else if(x>61961){printf("61967\n");return 0;}
else if(x>61949){printf("61961\n");return 0;}
else if(x>61933){printf("61949\n");return 0;}
else if(x>61927){printf("61933\n");return 0;}
else if(x>61909){printf("61927\n");return 0;}
else if(x>61879){printf("61909\n");return 0;}
else if(x>61871){printf("61879\n");return 0;}
else if(x>61861){printf("61871\n");return 0;}
else if(x>61843){printf("61861\n");return 0;}
else if(x>61837){printf("61843\n");return 0;}
else if(x>61819){printf("61837\n");return 0;}
else if(x>61813){printf("61819\n");return 0;}
else if(x>61781){printf("61813\n");return 0;}
else if(x>61757){printf("61781\n");return 0;}
else if(x>61751){printf("61757\n");return 0;}
else if(x>61729){printf("61751\n");return 0;}
else if(x>61723){printf("61729\n");return 0;}
else if(x>61717){printf("61723\n");return 0;}
else if(x>61703){printf("61717\n");return 0;}
else if(x>61687){printf("61703\n");return 0;}
else if(x>61681){printf("61687\n");return 0;}
else if(x>61673){printf("61681\n");return 0;}
else if(x>61667){printf("61673\n");return 0;}
else if(x>61657){printf("61667\n");return 0;}
else if(x>61651){printf("61657\n");return 0;}
else if(x>61643){printf("61651\n");return 0;}
else if(x>61637){printf("61643\n");return 0;}
else if(x>61631){printf("61637\n");return 0;}
else if(x>61627){printf("61631\n");return 0;}
else if(x>61613){printf("61627\n");return 0;}
else if(x>61609){printf("61613\n");return 0;}
else if(x>61603){printf("61609\n");return 0;}
else if(x>61583){printf("61603\n");return 0;}
else if(x>61561){printf("61583\n");return 0;}
else if(x>61559){printf("61561\n");return 0;}
else if(x>61553){printf("61559\n");return 0;}
else if(x>61547){printf("61553\n");return 0;}
else if(x>61543){printf("61547\n");return 0;}
else if(x>61519){printf("61543\n");return 0;}
else if(x>61511){printf("61519\n");return 0;}
else if(x>61507){printf("61511\n");return 0;}
else if(x>61493){printf("61507\n");return 0;}
else if(x>61487){printf("61493\n");return 0;}
else if(x>61483){printf("61487\n");return 0;}
else if(x>61471){printf("61483\n");return 0;}
else if(x>61469){printf("61471\n");return 0;}
else if(x>61463){printf("61469\n");return 0;}
else if(x>61441){printf("61463\n");return 0;}
else if(x>61417){printf("61441\n");return 0;}
else if(x>61409){printf("61417\n");return 0;}
else if(x>61403){printf("61409\n");return 0;}
else if(x>61381){printf("61403\n");return 0;}
else if(x>61379){printf("61381\n");return 0;}
else if(x>61363){printf("61379\n");return 0;}
else if(x>61357){printf("61363\n");return 0;}
else if(x>61343){printf("61357\n");return 0;}
else if(x>61339){printf("61343\n");return 0;}
else if(x>61333){printf("61339\n");return 0;}
else if(x>61331){printf("61333\n");return 0;}
else if(x>61297){printf("61331\n");return 0;}
else if(x>61291){printf("61297\n");return 0;}
else if(x>61283){printf("61291\n");return 0;}
else if(x>61261){printf("61283\n");return 0;}
else if(x>61253){printf("61261\n");return 0;}
else if(x>61231){printf("61253\n");return 0;}
else if(x>61223){printf("61231\n");return 0;}
else if(x>61211){printf("61223\n");return 0;}
else if(x>61169){printf("61211\n");return 0;}
else if(x>61153){printf("61169\n");return 0;}
else if(x>61151){printf("61153\n");return 0;}
else if(x>61141){printf("61151\n");return 0;}
else if(x>61129){printf("61141\n");return 0;}
else if(x>61121){printf("61129\n");return 0;}
else if(x>61099){printf("61121\n");return 0;}
else if(x>61091){printf("61099\n");return 0;}
else if(x>61057){printf("61091\n");return 0;}
else if(x>61051){printf("61057\n");return 0;}
else if(x>61043){printf("61051\n");return 0;}
else if(x>61031){printf("61043\n");return 0;}
else if(x>61027){printf("61031\n");return 0;}
else if(x>61007){printf("61027\n");return 0;}
else if(x>61001){printf("61007\n");return 0;}
else if(x>60961){printf("61001\n");return 0;}
else if(x>60953){printf("60961\n");return 0;}
else if(x>60943){printf("60953\n");return 0;}
else if(x>60937){printf("60943\n");return 0;}
else if(x>60923){printf("60937\n");return 0;}
else if(x>60919){printf("60923\n");return 0;}
else if(x>60917){printf("60919\n");return 0;}
else if(x>60913){printf("60917\n");return 0;}
else if(x>60901){printf("60913\n");return 0;}
else if(x>60899){printf("60901\n");return 0;}
else if(x>60889){printf("60899\n");return 0;}
else if(x>60887){printf("60889\n");return 0;}
else if(x>60869){printf("60887\n");return 0;}
else if(x>60859){printf("60869\n");return 0;}
else if(x>60821){printf("60859\n");return 0;}
else if(x>60811){printf("60821\n");return 0;}
else if(x>60793){printf("60811\n");return 0;}
else if(x>60779){printf("60793\n");return 0;}
else if(x>60773){printf("60779\n");return 0;}
else if(x>60763){printf("60773\n");return 0;}
else if(x>60761){printf("60763\n");return 0;}
else if(x>60757){printf("60761\n");return 0;}
else if(x>60737){printf("60757\n");return 0;}
else if(x>60733){printf("60737\n");return 0;}
else if(x>60727){printf("60733\n");return 0;}
else if(x>60719){printf("60727\n");return 0;}
else if(x>60703){printf("60719\n");return 0;}
else if(x>60689){printf("60703\n");return 0;}
else if(x>60679){printf("60689\n");return 0;}
else if(x>60661){printf("60679\n");return 0;}
else if(x>60659){printf("60661\n");return 0;}
else if(x>60649){printf("60659\n");return 0;}
else if(x>60647){printf("60649\n");return 0;}
else if(x>60637){printf("60647\n");return 0;}
else if(x>60631){printf("60637\n");return 0;}
else if(x>60623){printf("60631\n");return 0;}
else if(x>60617){printf("60623\n");return 0;}
else if(x>60611){printf("60617\n");return 0;}
else if(x>60607){printf("60611\n");return 0;}
else if(x>60601){printf("60607\n");return 0;}
else if(x>60589){printf("60601\n");return 0;}
else if(x>60539){printf("60589\n");return 0;}
else if(x>60527){printf("60539\n");return 0;}
else if(x>60521){printf("60527\n");return 0;}
else if(x>60509){printf("60521\n");return 0;}
else if(x>60497){printf("60509\n");return 0;}
else if(x>60493){printf("60497\n");return 0;}
else if(x>60457){printf("60493\n");return 0;}
else if(x>60449){printf("60457\n");return 0;}
else if(x>60443){printf("60449\n");return 0;}
else if(x>60427){printf("60443\n");return 0;}
else if(x>60413){printf("60427\n");return 0;}
else if(x>60397){printf("60413\n");return 0;}
else if(x>60383){printf("60397\n");return 0;}
else if(x>60373){printf("60383\n");return 0;}
else if(x>60353){printf("60373\n");return 0;}
else if(x>60343){printf("60353\n");return 0;}
else if(x>60337){printf("60343\n");return 0;}
else if(x>60331){printf("60337\n");return 0;}
else if(x>60317){printf("60331\n");return 0;}
else if(x>60293){printf("60317\n");return 0;}
else if(x>60289){printf("60293\n");return 0;}
else if(x>60271){printf("60289\n");return 0;}
else if(x>60259){printf("60271\n");return 0;}
else if(x>60257){printf("60259\n");return 0;}
else if(x>60251){printf("60257\n");return 0;}
else if(x>60223){printf("60251\n");return 0;}
else if(x>60217){printf("60223\n");return 0;}
else if(x>60209){printf("60217\n");return 0;}
else if(x>60169){printf("60209\n");return 0;}
else if(x>60167){printf("60169\n");return 0;}
else if(x>60161){printf("60167\n");return 0;}
else if(x>60149){printf("60161\n");return 0;}
else if(x>60139){printf("60149\n");return 0;}
else if(x>60133){printf("60139\n");return 0;}
else if(x>60127){printf("60133\n");return 0;}
else if(x>60107){printf("60127\n");return 0;}
else if(x>60103){printf("60107\n");return 0;}
else if(x>60101){printf("60103\n");return 0;}
else if(x>60091){printf("60101\n");return 0;}
else if(x>60089){printf("60091\n");return 0;}
else if(x>60083){printf("60089\n");return 0;}
else if(x>60077){printf("60083\n");return 0;}
else if(x>60041){printf("60077\n");return 0;}
else if(x>60037){printf("60041\n");return 0;}
else if(x>60029){printf("60037\n");return 0;}
else if(x>60017){printf("60029\n");return 0;}
else if(x>60013){printf("60017\n");return 0;}
else if(x>59999){printf("60013\n");return 0;}
else if(x>59981){printf("59999\n");return 0;}
else if(x>59971){printf("59981\n");return 0;}
else if(x>59957){printf("59971\n");return 0;}
else if(x>59951){printf("59957\n");return 0;}
else if(x>59929){printf("59951\n");return 0;}
else if(x>59921){printf("59929\n");return 0;}
else if(x>59887){printf("59921\n");return 0;}
else if(x>59879){printf("59887\n");return 0;}
else if(x>59863){printf("59879\n");return 0;}
else if(x>59833){printf("59863\n");return 0;}
else if(x>59809){printf("59833\n");return 0;}
else if(x>59797){printf("59809\n");return 0;}
else if(x>59791){printf("59797\n");return 0;}
else if(x>59779){printf("59791\n");return 0;}
else if(x>59771){printf("59779\n");return 0;}
else if(x>59753){printf("59771\n");return 0;}
else if(x>59747){printf("59753\n");return 0;}
else if(x>59743){printf("59747\n");return 0;}
else if(x>59729){printf("59743\n");return 0;}
else if(x>59723){printf("59729\n");return 0;}
else if(x>59707){printf("59723\n");return 0;}
else if(x>59699){printf("59707\n");return 0;}
else if(x>59693){printf("59699\n");return 0;}
else if(x>59671){printf("59693\n");return 0;}
else if(x>59669){printf("59671\n");return 0;}
else if(x>59663){printf("59669\n");return 0;}
else if(x>59659){printf("59663\n");return 0;}
else if(x>59651){printf("59659\n");return 0;}
else if(x>59629){printf("59651\n");return 0;}
else if(x>59627){printf("59629\n");return 0;}
else if(x>59621){printf("59627\n");return 0;}
else if(x>59617){printf("59621\n");return 0;}
else if(x>59611){printf("59617\n");return 0;}
else if(x>59581){printf("59611\n");return 0;}
else if(x>59567){printf("59581\n");return 0;}
else if(x>59561){printf("59567\n");return 0;}
else if(x>59557){printf("59561\n");return 0;}
else if(x>59539){printf("59557\n");return 0;}
else if(x>59513){printf("59539\n");return 0;}
else if(x>59509){printf("59513\n");return 0;}
else if(x>59497){printf("59509\n");return 0;}
else if(x>59473){printf("59497\n");return 0;}
else if(x>59471){printf("59473\n");return 0;}
else if(x>59467){printf("59471\n");return 0;}
else if(x>59453){printf("59467\n");return 0;}
else if(x>59447){printf("59453\n");return 0;}
else if(x>59443){printf("59447\n");return 0;}
else if(x>59441){printf("59443\n");return 0;}
else if(x>59419){printf("59441\n");return 0;}
else if(x>59417){printf("59419\n");return 0;}
else if(x>59407){printf("59417\n");return 0;}
else if(x>59399){printf("59407\n");return 0;}
else if(x>59393){printf("59399\n");return 0;}
else if(x>59387){printf("59393\n");return 0;}
else if(x>59377){printf("59387\n");return 0;}
else if(x>59369){printf("59377\n");return 0;}
else if(x>59359){printf("59369\n");return 0;}
else if(x>59357){printf("59359\n");return 0;}
else if(x>59351){printf("59357\n");return 0;}
else if(x>59341){printf("59351\n");return 0;}
else if(x>59333){printf("59341\n");return 0;}
else if(x>59281){printf("59333\n");return 0;}
else if(x>59273){printf("59281\n");return 0;}
else if(x>59263){printf("59273\n");return 0;}
else if(x>59243){printf("59263\n");return 0;}
else if(x>59239){printf("59243\n");return 0;}
else if(x>59233){printf("59239\n");return 0;}
else if(x>59221){printf("59233\n");return 0;}
else if(x>59219){printf("59221\n");return 0;}
else if(x>59209){printf("59219\n");return 0;}
else if(x>59207){printf("59209\n");return 0;}
else if(x>59197){printf("59207\n");return 0;}
else if(x>59183){printf("59197\n");return 0;}
else if(x>59167){printf("59183\n");return 0;}
else if(x>59159){printf("59167\n");return 0;}
else if(x>59149){printf("59159\n");return 0;}
else if(x>59141){printf("59149\n");return 0;}
else if(x>59123){printf("59141\n");return 0;}
else if(x>59119){printf("59123\n");return 0;}
else if(x>59113){printf("59119\n");return 0;}
else if(x>59107){printf("59113\n");return 0;}
else if(x>59093){printf("59107\n");return 0;}
else if(x>59083){printf("59093\n");return 0;}
else if(x>59077){printf("59083\n");return 0;}
else if(x>59069){printf("59077\n");return 0;}
else if(x>59063){printf("59069\n");return 0;}
else if(x>59053){printf("59063\n");return 0;}
else if(x>59051){printf("59053\n");return 0;}
else if(x>59029){printf("59051\n");return 0;}
else if(x>59023){printf("59029\n");return 0;}
else if(x>59021){printf("59023\n");return 0;}
else if(x>59011){printf("59021\n");return 0;}
else if(x>59009){printf("59011\n");return 0;}
else if(x>58997){printf("59009\n");return 0;}
else if(x>58991){printf("58997\n");return 0;}
else if(x>58979){printf("58991\n");return 0;}
else if(x>58967){printf("58979\n");return 0;}
else if(x>58963){printf("58967\n");return 0;}
else if(x>58943){printf("58963\n");return 0;}
else if(x>58937){printf("58943\n");return 0;}
else if(x>58921){printf("58937\n");return 0;}
else if(x>58913){printf("58921\n");return 0;}
else if(x>58909){printf("58913\n");return 0;}
else if(x>58907){printf("58909\n");return 0;}
else if(x>58901){printf("58907\n");return 0;}
else if(x>58897){printf("58901\n");return 0;}
else if(x>58889){printf("58897\n");return 0;}
else if(x>58831){printf("58889\n");return 0;}
else if(x>58789){printf("58831\n");return 0;}
else if(x>58787){printf("58789\n");return 0;}
else if(x>58771){printf("58787\n");return 0;}
else if(x>58763){printf("58771\n");return 0;}
else if(x>58757){printf("58763\n");return 0;}
else if(x>58741){printf("58757\n");return 0;}
else if(x>58733){printf("58741\n");return 0;}
else if(x>58727){printf("58733\n");return 0;}
else if(x>58711){printf("58727\n");return 0;}
else if(x>58699){printf("58711\n");return 0;}
else if(x>58693){printf("58699\n");return 0;}
else if(x>58687){printf("58693\n");return 0;}
else if(x>58679){printf("58687\n");return 0;}
else if(x>58661){printf("58679\n");return 0;}
else if(x>58657){printf("58661\n");return 0;}
else if(x>58631){printf("58657\n");return 0;}
else if(x>58613){printf("58631\n");return 0;}
else if(x>58603){printf("58613\n");return 0;}
else if(x>58601){printf("58603\n");return 0;}
else if(x>58579){printf("58601\n");return 0;}
else if(x>58573){printf("58579\n");return 0;}
else if(x>58567){printf("58573\n");return 0;}
else if(x>58549){printf("58567\n");return 0;}
else if(x>58543){printf("58549\n");return 0;}
else if(x>58537){printf("58543\n");return 0;}
else if(x>58511){printf("58537\n");return 0;}
else if(x>58481){printf("58511\n");return 0;}
else if(x>58477){printf("58481\n");return 0;}
else if(x>58453){printf("58477\n");return 0;}
else if(x>58451){printf("58453\n");return 0;}
else if(x>58441){printf("58451\n");return 0;}
else if(x>58439){printf("58441\n");return 0;}
else if(x>58427){printf("58439\n");return 0;}
else if(x>58417){printf("58427\n");return 0;}
else if(x>58411){printf("58417\n");return 0;}
else if(x>58403){printf("58411\n");return 0;}
else if(x>58393){printf("58403\n");return 0;}
else if(x>58391){printf("58393\n");return 0;}
else if(x>58379){printf("58391\n");return 0;}
else if(x>58369){printf("58379\n");return 0;}
else if(x>58367){printf("58369\n");return 0;}
else if(x>58363){printf("58367\n");return 0;}
else if(x>58337){printf("58363\n");return 0;}
else if(x>58321){printf("58337\n");return 0;}
else if(x>58313){printf("58321\n");return 0;}
else if(x>58309){printf("58313\n");return 0;}
else if(x>58271){printf("58309\n");return 0;}
else if(x>58243){printf("58271\n");return 0;}
else if(x>58237){printf("58243\n");return 0;}
else if(x>58231){printf("58237\n");return 0;}
else if(x>58229){printf("58231\n");return 0;}
else if(x>58217){printf("58229\n");return 0;}
else if(x>58211){printf("58217\n");return 0;}
else if(x>58207){printf("58211\n");return 0;}
else if(x>58199){printf("58207\n");return 0;}
else if(x>58193){printf("58199\n");return 0;}
else if(x>58189){printf("58193\n");return 0;}
else if(x>58171){printf("58189\n");return 0;}
else if(x>58169){printf("58171\n");return 0;}
else if(x>58153){printf("58169\n");return 0;}
else if(x>58151){printf("58153\n");return 0;}
else if(x>58147){printf("58151\n");return 0;}
else if(x>58129){printf("58147\n");return 0;}
else if(x>58111){printf("58129\n");return 0;}
else if(x>58109){printf("58111\n");return 0;}
else if(x>58099){printf("58109\n");return 0;}
else if(x>58073){printf("58099\n");return 0;}
else if(x>58067){printf("58073\n");return 0;}
else if(x>58061){printf("58067\n");return 0;}
else if(x>58057){printf("58061\n");return 0;}
else if(x>58049){printf("58057\n");return 0;}
else if(x>58043){printf("58049\n");return 0;}
else if(x>58031){printf("58043\n");return 0;}
else if(x>58027){printf("58031\n");return 0;}
else if(x>58013){printf("58027\n");return 0;}
else if(x>57991){printf("58013\n");return 0;}
else if(x>57977){printf("57991\n");return 0;}
else if(x>57973){printf("57977\n");return 0;}
else if(x>57947){printf("57973\n");return 0;}
else if(x>57943){printf("57947\n");return 0;}
else if(x>57923){printf("57943\n");return 0;}
else if(x>57917){printf("57923\n");return 0;}
else if(x>57901){printf("57917\n");return 0;}
else if(x>57899){printf("57901\n");return 0;}
else if(x>57881){printf("57899\n");return 0;}
else if(x>57859){printf("57881\n");return 0;}
else if(x>57853){printf("57859\n");return 0;}
else if(x>57847){printf("57853\n");return 0;}
else if(x>57839){printf("57847\n");return 0;}
else if(x>57829){printf("57839\n");return 0;}
else if(x>57809){printf("57829\n");return 0;}
else if(x>57803){printf("57809\n");return 0;}
else if(x>57793){printf("57803\n");return 0;}
else if(x>57791){printf("57793\n");return 0;}
else if(x>57787){printf("57791\n");return 0;}
else if(x>57781){printf("57787\n");return 0;}
else if(x>57773){printf("57781\n");return 0;}
else if(x>57751){printf("57773\n");return 0;}
else if(x>57737){printf("57751\n");return 0;}
else if(x>57731){printf("57737\n");return 0;}
else if(x>57727){printf("57731\n");return 0;}
else if(x>57719){printf("57727\n");return 0;}
else if(x>57713){printf("57719\n");return 0;}
else if(x>57709){printf("57713\n");return 0;}
else if(x>57697){printf("57709\n");return 0;}
else if(x>57689){printf("57697\n");return 0;}
else if(x>57679){printf("57689\n");return 0;}
else if(x>57667){printf("57679\n");return 0;}
else if(x>57653){printf("57667\n");return 0;}
else if(x>57649){printf("57653\n");return 0;}
else if(x>57641){printf("57649\n");return 0;}
else if(x>57637){printf("57641\n");return 0;}
else if(x>57601){printf("57637\n");return 0;}
else if(x>57593){printf("57601\n");return 0;}
else if(x>57587){printf("57593\n");return 0;}
else if(x>57571){printf("57587\n");return 0;}
else if(x>57559){printf("57571\n");return 0;}
else if(x>57557){printf("57559\n");return 0;}
else if(x>57529){printf("57557\n");return 0;}
else if(x>57527){printf("57529\n");return 0;}
else if(x>57503){printf("57527\n");return 0;}
else if(x>57493){printf("57503\n");return 0;}
else if(x>57487){printf("57493\n");return 0;}
else if(x>57467){printf("57487\n");return 0;}
else if(x>57457){printf("57467\n");return 0;}
else if(x>57427){printf("57457\n");return 0;}
else if(x>57413){printf("57427\n");return 0;}
else if(x>57397){printf("57413\n");return 0;}
else if(x>57389){printf("57397\n");return 0;}
else if(x>57383){printf("57389\n");return 0;}
else if(x>57373){printf("57383\n");return 0;}
else if(x>57367){printf("57373\n");return 0;}
else if(x>57349){printf("57367\n");return 0;}
else if(x>57347){printf("57349\n");return 0;}
else if(x>57331){printf("57347\n");return 0;}
else if(x>57329){printf("57331\n");return 0;}
else if(x>57301){printf("57329\n");return 0;}
else if(x>57287){printf("57301\n");return 0;}
else if(x>57283){printf("57287\n");return 0;}
else if(x>57271){printf("57283\n");return 0;}
else if(x>57269){printf("57271\n");return 0;}
else if(x>57259){printf("57269\n");return 0;}
else if(x>57251){printf("57259\n");return 0;}
else if(x>57241){printf("57251\n");return 0;}
else if(x>57223){printf("57241\n");return 0;}
else if(x>57221){printf("57223\n");return 0;}
else if(x>57203){printf("57221\n");return 0;}
else if(x>57193){printf("57203\n");return 0;}
else if(x>57191){printf("57193\n");return 0;}
else if(x>57179){printf("57191\n");return 0;}
else if(x>57173){printf("57179\n");return 0;}
else if(x>57163){printf("57173\n");return 0;}
else if(x>57149){printf("57163\n");return 0;}
else if(x>57143){printf("57149\n");return 0;}
else if(x>57139){printf("57143\n");return 0;}
else if(x>57131){printf("57139\n");return 0;}
else if(x>57119){printf("57131\n");return 0;}
else if(x>57107){printf("57119\n");return 0;}
else if(x>57097){printf("57107\n");return 0;}
else if(x>57089){printf("57097\n");return 0;}
else if(x>57077){printf("57089\n");return 0;}
else if(x>57073){printf("57077\n");return 0;}
else if(x>57059){printf("57073\n");return 0;}
else if(x>57047){printf("57059\n");return 0;}
else if(x>57041){printf("57047\n");return 0;}
else if(x>57037){printf("57041\n");return 0;}
else if(x>56999){printf("57037\n");return 0;}
else if(x>56993){printf("56999\n");return 0;}
else if(x>56989){printf("56993\n");return 0;}
else if(x>56983){printf("56989\n");return 0;}
else if(x>56963){printf("56983\n");return 0;}
else if(x>56957){printf("56963\n");return 0;}
else if(x>56951){printf("56957\n");return 0;}
else if(x>56941){printf("56951\n");return 0;}
else if(x>56929){printf("56941\n");return 0;}
else if(x>56923){printf("56929\n");return 0;}
else if(x>56921){printf("56923\n");return 0;}
else if(x>56911){printf("56921\n");return 0;}
else if(x>56909){printf("56911\n");return 0;}
else if(x>56897){printf("56909\n");return 0;}
else if(x>56893){printf("56897\n");return 0;}
else if(x>56891){printf("56893\n");return 0;}
else if(x>56873){printf("56891\n");return 0;}
else if(x>56857){printf("56873\n");return 0;}
else if(x>56843){printf("56857\n");return 0;}
else if(x>56827){printf("56843\n");return 0;}
else if(x>56821){printf("56827\n");return 0;}
else if(x>56813){printf("56821\n");return 0;}
else if(x>56809){printf("56813\n");return 0;}
else if(x>56807){printf("56809\n");return 0;}
else if(x>56783){printf("56807\n");return 0;}
else if(x>56779){printf("56783\n");return 0;}
else if(x>56773){printf("56779\n");return 0;}
else if(x>56767){printf("56773\n");return 0;}
else if(x>56747){printf("56767\n");return 0;}
else if(x>56737){printf("56747\n");return 0;}
else if(x>56731){printf("56737\n");return 0;}
else if(x>56713){printf("56731\n");return 0;}
else if(x>56711){printf("56713\n");return 0;}
else if(x>56701){printf("56711\n");return 0;}
else if(x>56687){printf("56701\n");return 0;}
else if(x>56681){printf("56687\n");return 0;}
else if(x>56671){printf("56681\n");return 0;}
else if(x>56663){printf("56671\n");return 0;}
else if(x>56659){printf("56663\n");return 0;}
else if(x>56633){printf("56659\n");return 0;}
else if(x>56629){printf("56633\n");return 0;}
else if(x>56611){printf("56629\n");return 0;}
else if(x>56599){printf("56611\n");return 0;}
else if(x>56597){printf("56599\n");return 0;}
else if(x>56591){printf("56597\n");return 0;}
else if(x>56569){printf("56591\n");return 0;}
else if(x>56543){printf("56569\n");return 0;}
else if(x>56533){printf("56543\n");return 0;}
else if(x>56531){printf("56533\n");return 0;}
else if(x>56527){printf("56531\n");return 0;}
else if(x>56519){printf("56527\n");return 0;}
else if(x>56509){printf("56519\n");return 0;}
else if(x>56503){printf("56509\n");return 0;}
else if(x>56501){printf("56503\n");return 0;}
else if(x>56489){printf("56501\n");return 0;}
else if(x>56479){printf("56489\n");return 0;}
else if(x>56477){printf("56479\n");return 0;}
else if(x>56473){printf("56477\n");return 0;}
else if(x>56467){printf("56473\n");return 0;}
else if(x>56453){printf("56467\n");return 0;}
else if(x>56443){printf("56453\n");return 0;}
else if(x>56437){printf("56443\n");return 0;}
else if(x>56431){printf("56437\n");return 0;}
else if(x>56417){printf("56431\n");return 0;}
else if(x>56401){printf("56417\n");return 0;}
else if(x>56393){printf("56401\n");return 0;}
else if(x>56383){printf("56393\n");return 0;}
else if(x>56377){printf("56383\n");return 0;}
else if(x>56369){printf("56377\n");return 0;}
else if(x>56359){printf("56369\n");return 0;}
else if(x>56333){printf("56359\n");return 0;}
else if(x>56311){printf("56333\n");return 0;}
else if(x>56299){printf("56311\n");return 0;}
else if(x>56269){printf("56299\n");return 0;}
else if(x>56267){printf("56269\n");return 0;}
else if(x>56263){printf("56267\n");return 0;}
else if(x>56249){printf("56263\n");return 0;}
else if(x>56239){printf("56249\n");return 0;}
else if(x>56237){printf("56239\n");return 0;}
else if(x>56209){printf("56237\n");return 0;}
else if(x>56207){printf("56209\n");return 0;}
else if(x>56197){printf("56207\n");return 0;}
else if(x>56179){printf("56197\n");return 0;}
else if(x>56171){printf("56179\n");return 0;}
else if(x>56167){printf("56171\n");return 0;}
else if(x>56149){printf("56167\n");return 0;}
else if(x>56131){printf("56149\n");return 0;}
else if(x>56123){printf("56131\n");return 0;}
else if(x>56113){printf("56123\n");return 0;}
else if(x>56101){printf("56113\n");return 0;}
else if(x>56099){printf("56101\n");return 0;}
else if(x>56093){printf("56099\n");return 0;}
else if(x>56087){printf("56093\n");return 0;}
else if(x>56081){printf("56087\n");return 0;}
else if(x>56053){printf("56081\n");return 0;}
else if(x>56041){printf("56053\n");return 0;}
else if(x>56039){printf("56041\n");return 0;}
else if(x>56009){printf("56039\n");return 0;}
else if(x>56003){printf("56009\n");return 0;}
else if(x>55997){printf("56003\n");return 0;}
else if(x>55987){printf("55997\n");return 0;}
else if(x>55967){printf("55987\n");return 0;}
else if(x>55949){printf("55967\n");return 0;}
else if(x>55933){printf("55949\n");return 0;}
else if(x>55931){printf("55933\n");return 0;}
else if(x>55927){printf("55931\n");return 0;}
else if(x>55921){printf("55927\n");return 0;}
else if(x>55903){printf("55921\n");return 0;}
else if(x>55901){printf("55903\n");return 0;}
else if(x>55897){printf("55901\n");return 0;}
else if(x>55889){printf("55897\n");return 0;}
else if(x>55871){printf("55889\n");return 0;}
else if(x>55849){printf("55871\n");return 0;}
else if(x>55843){printf("55849\n");return 0;}
else if(x>55837){printf("55843\n");return 0;}
else if(x>55829){printf("55837\n");return 0;}
else if(x>55823){printf("55829\n");return 0;}
else if(x>55819){printf("55823\n");return 0;}
else if(x>55817){printf("55819\n");return 0;}
else if(x>55813){printf("55817\n");return 0;}
else if(x>55807){printf("55813\n");return 0;}
else if(x>55799){printf("55807\n");return 0;}
else if(x>55793){printf("55799\n");return 0;}
else if(x>55787){printf("55793\n");return 0;}
else if(x>55763){printf("55787\n");return 0;}
else if(x>55733){printf("55763\n");return 0;}
else if(x>55721){printf("55733\n");return 0;}
else if(x>55717){printf("55721\n");return 0;}
else if(x>55711){printf("55717\n");return 0;}
else if(x>55697){printf("55711\n");return 0;}
else if(x>55691){printf("55697\n");return 0;}
else if(x>55681){printf("55691\n");return 0;}
else if(x>55673){printf("55681\n");return 0;}
else if(x>55667){printf("55673\n");return 0;}
else if(x>55663){printf("55667\n");return 0;}
else if(x>55661){printf("55663\n");return 0;}
else if(x>55639){printf("55661\n");return 0;}
else if(x>55633){printf("55639\n");return 0;}
else if(x>55631){printf("55633\n");return 0;}
else if(x>55621){printf("55631\n");return 0;}
else if(x>55619){printf("55621\n");return 0;}
else if(x>55609){printf("55619\n");return 0;}
else if(x>55603){printf("55609\n");return 0;}
else if(x>55589){printf("55603\n");return 0;}
else if(x>55579){printf("55589\n");return 0;}
else if(x>55547){printf("55579\n");return 0;}
else if(x>55541){printf("55547\n");return 0;}
else if(x>55529){printf("55541\n");return 0;}
else if(x>55511){printf("55529\n");return 0;}
else if(x>55501){printf("55511\n");return 0;}
else if(x>55487){printf("55501\n");return 0;}
else if(x>55469){printf("55487\n");return 0;}
else if(x>55457){printf("55469\n");return 0;}
else if(x>55441){printf("55457\n");return 0;}
else if(x>55439){printf("55441\n");return 0;}
else if(x>55411){printf("55439\n");return 0;}
else if(x>55399){printf("55411\n");return 0;}
else if(x>55381){printf("55399\n");return 0;}
else if(x>55373){printf("55381\n");return 0;}
else if(x>55351){printf("55373\n");return 0;}
else if(x>55343){printf("55351\n");return 0;}
else if(x>55339){printf("55343\n");return 0;}
else if(x>55337){printf("55339\n");return 0;}
else if(x>55333){printf("55337\n");return 0;}
else if(x>55331){printf("55333\n");return 0;}
else if(x>55313){printf("55331\n");return 0;}
else if(x>55291){printf("55313\n");return 0;}
else if(x>55259){printf("55291\n");return 0;}
else if(x>55249){printf("55259\n");return 0;}
else if(x>55243){printf("55249\n");return 0;}
else if(x>55229){printf("55243\n");return 0;}
else if(x>55219){printf("55229\n");return 0;}
else if(x>55217){printf("55219\n");return 0;}
else if(x>55213){printf("55217\n");return 0;}
else if(x>55207){printf("55213\n");return 0;}
else if(x>55201){printf("55207\n");return 0;}
else if(x>55171){printf("55201\n");return 0;}
else if(x>55163){printf("55171\n");return 0;}
else if(x>55147){printf("55163\n");return 0;}
else if(x>55127){printf("55147\n");return 0;}
else if(x>55117){printf("55127\n");return 0;}
else if(x>55109){printf("55117\n");return 0;}
else if(x>55103){printf("55109\n");return 0;}
else if(x>55079){printf("55103\n");return 0;}
else if(x>55073){printf("55079\n");return 0;}
else if(x>55061){printf("55073\n");return 0;}
else if(x>55057){printf("55061\n");return 0;}
else if(x>55051){printf("55057\n");return 0;}
else if(x>55049){printf("55051\n");return 0;}
else if(x>55021){printf("55049\n");return 0;}
else if(x>55009){printf("55021\n");return 0;}
else if(x>55001){printf("55009\n");return 0;}
else if(x>54983){printf("55001\n");return 0;}
else if(x>54979){printf("54983\n");return 0;}
else if(x>54973){printf("54979\n");return 0;}
else if(x>54959){printf("54973\n");return 0;}
else if(x>54949){printf("54959\n");return 0;}
else if(x>54941){printf("54949\n");return 0;}
else if(x>54919){printf("54941\n");return 0;}
else if(x>54917){printf("54919\n");return 0;}
else if(x>54907){printf("54917\n");return 0;}
else if(x>54881){printf("54907\n");return 0;}
else if(x>54877){printf("54881\n");return 0;}
else if(x>54869){printf("54877\n");return 0;}
else if(x>54851){printf("54869\n");return 0;}
else if(x>54833){printf("54851\n");return 0;}
else if(x>54829){printf("54833\n");return 0;}
else if(x>54799){printf("54829\n");return 0;}
else if(x>54787){printf("54799\n");return 0;}
else if(x>54779){printf("54787\n");return 0;}
else if(x>54773){printf("54779\n");return 0;}
else if(x>54767){printf("54773\n");return 0;}
else if(x>54751){printf("54767\n");return 0;}
else if(x>54727){printf("54751\n");return 0;}
else if(x>54721){printf("54727\n");return 0;}
else if(x>54713){printf("54721\n");return 0;}
else if(x>54709){printf("54713\n");return 0;}
else if(x>54679){printf("54709\n");return 0;}
else if(x>54673){printf("54679\n");return 0;}
else if(x>54667){printf("54673\n");return 0;}
else if(x>54647){printf("54667\n");return 0;}
else if(x>54631){printf("54647\n");return 0;}
else if(x>54629){printf("54631\n");return 0;}
else if(x>54623){printf("54629\n");return 0;}
else if(x>54617){printf("54623\n");return 0;}
else if(x>54601){printf("54617\n");return 0;}
else if(x>54583){printf("54601\n");return 0;}
else if(x>54581){printf("54583\n");return 0;}
else if(x>54577){printf("54581\n");return 0;}
else if(x>54563){printf("54577\n");return 0;}
else if(x>54559){printf("54563\n");return 0;}
else if(x>54547){printf("54559\n");return 0;}
else if(x>54541){printf("54547\n");return 0;}
else if(x>54539){printf("54541\n");return 0;}
else if(x>54521){printf("54539\n");return 0;}
else if(x>54517){printf("54521\n");return 0;}
else if(x>54503){printf("54517\n");return 0;}
else if(x>54499){printf("54503\n");return 0;}
else if(x>54497){printf("54499\n");return 0;}
else if(x>54493){printf("54497\n");return 0;}
else if(x>54469){printf("54493\n");return 0;}
else if(x>54449){printf("54469\n");return 0;}
else if(x>54443){printf("54449\n");return 0;}
else if(x>54437){printf("54443\n");return 0;}
else if(x>54421){printf("54437\n");return 0;}
else if(x>54419){printf("54421\n");return 0;}
else if(x>54413){printf("54419\n");return 0;}
else if(x>54409){printf("54413\n");return 0;}
else if(x>54403){printf("54409\n");return 0;}
else if(x>54401){printf("54403\n");return 0;}
else if(x>54377){printf("54401\n");return 0;}
else if(x>54371){printf("54377\n");return 0;}
else if(x>54367){printf("54371\n");return 0;}
else if(x>54361){printf("54367\n");return 0;}
else if(x>54347){printf("54361\n");return 0;}
else if(x>54331){printf("54347\n");return 0;}
else if(x>54323){printf("54331\n");return 0;}
else if(x>54319){printf("54323\n");return 0;}
else if(x>54311){printf("54319\n");return 0;}
else if(x>54293){printf("54311\n");return 0;}
else if(x>54287){printf("54293\n");return 0;}
else if(x>54277){printf("54287\n");return 0;}
else if(x>54269){printf("54277\n");return 0;}
else if(x>54251){printf("54269\n");return 0;}
else if(x>54217){printf("54251\n");return 0;}
else if(x>54193){printf("54217\n");return 0;}
else if(x>54181){printf("54193\n");return 0;}
else if(x>54167){printf("54181\n");return 0;}
else if(x>54163){printf("54167\n");return 0;}
else if(x>54151){printf("54163\n");return 0;}
else if(x>54139){printf("54151\n");return 0;}
else if(x>54133){printf("54139\n");return 0;}
else if(x>54121){printf("54133\n");return 0;}
else if(x>54101){printf("54121\n");return 0;}
else if(x>54091){printf("54101\n");return 0;}
else if(x>54083){printf("54091\n");return 0;}
else if(x>54059){printf("54083\n");return 0;}
else if(x>54049){printf("54059\n");return 0;}
else if(x>54037){printf("54049\n");return 0;}
else if(x>54013){printf("54037\n");return 0;}
else if(x>54011){printf("54013\n");return 0;}
else if(x>54001){printf("54011\n");return 0;}
else if(x>53993){printf("54001\n");return 0;}
else if(x>53987){printf("53993\n");return 0;}
else if(x>53959){printf("53987\n");return 0;}
else if(x>53951){printf("53959\n");return 0;}
else if(x>53939){printf("53951\n");return 0;}
else if(x>53927){printf("53939\n");return 0;}
else if(x>53923){printf("53927\n");return 0;}
else if(x>53917){printf("53923\n");return 0;}
else if(x>53899){printf("53917\n");return 0;}
else if(x>53897){printf("53899\n");return 0;}
else if(x>53891){printf("53897\n");return 0;}
else if(x>53887){printf("53891\n");return 0;}
else if(x>53881){printf("53887\n");return 0;}
else if(x>53861){printf("53881\n");return 0;}
else if(x>53857){printf("53861\n");return 0;}
else if(x>53849){printf("53857\n");return 0;}
else if(x>53831){printf("53849\n");return 0;}
else if(x>53819){printf("53831\n");return 0;}
else if(x>53813){printf("53819\n");return 0;}
else if(x>53791){printf("53813\n");return 0;}
else if(x>53783){printf("53791\n");return 0;}
else if(x>53777){printf("53783\n");return 0;}
else if(x>53773){printf("53777\n");return 0;}
else if(x>53759){printf("53773\n");return 0;}
else if(x>53731){printf("53759\n");return 0;}
else if(x>53719){printf("53731\n");return 0;}
else if(x>53717){printf("53719\n");return 0;}
else if(x>53699){printf("53717\n");return 0;}
else if(x>53693){printf("53699\n");return 0;}
else if(x>53681){printf("53693\n");return 0;}
else if(x>53657){printf("53681\n");return 0;}
else if(x>53653){printf("53657\n");return 0;}
else if(x>53639){printf("53653\n");return 0;}
else if(x>53633){printf("53639\n");return 0;}
else if(x>53629){printf("53633\n");return 0;}
else if(x>53623){printf("53629\n");return 0;}
else if(x>53617){printf("53623\n");return 0;}
else if(x>53611){printf("53617\n");return 0;}
else if(x>53609){printf("53611\n");return 0;}
else if(x>53597){printf("53609\n");return 0;}
else if(x>53593){printf("53597\n");return 0;}
else if(x>53591){printf("53593\n");return 0;}
else if(x>53569){printf("53591\n");return 0;}
else if(x>53551){printf("53569\n");return 0;}
else if(x>53549){printf("53551\n");return 0;}
else if(x>53527){printf("53549\n");return 0;}
else if(x>53507){printf("53527\n");return 0;}
else if(x>53503){printf("53507\n");return 0;}
else if(x>53479){printf("53503\n");return 0;}
else if(x>53453){printf("53479\n");return 0;}
else if(x>53441){printf("53453\n");return 0;}
else if(x>53437){printf("53441\n");return 0;}
else if(x>53419){printf("53437\n");return 0;}
else if(x>53411){printf("53419\n");return 0;}
else if(x>53407){printf("53411\n");return 0;}
else if(x>53401){printf("53407\n");return 0;}
else if(x>53381){printf("53401\n");return 0;}
else if(x>53377){printf("53381\n");return 0;}
else if(x>53359){printf("53377\n");return 0;}
else if(x>53353){printf("53359\n");return 0;}
else if(x>53327){printf("53353\n");return 0;}
else if(x>53323){printf("53327\n");return 0;}
else if(x>53309){printf("53323\n");return 0;}
else if(x>53299){printf("53309\n");return 0;}
else if(x>53281){printf("53299\n");return 0;}
else if(x>53279){printf("53281\n");return 0;}
else if(x>53269){printf("53279\n");return 0;}
else if(x>53267){printf("53269\n");return 0;}
else if(x>53239){printf("53267\n");return 0;}
else if(x>53233){printf("53239\n");return 0;}
else if(x>53231){printf("53233\n");return 0;}
else if(x>53201){printf("53231\n");return 0;}
else if(x>53197){printf("53201\n");return 0;}
else if(x>53189){printf("53197\n");return 0;}
else if(x>53173){printf("53189\n");return 0;}
else if(x>53171){printf("53173\n");return 0;}
else if(x>53161){printf("53171\n");return 0;}
else if(x>53149){printf("53161\n");return 0;}
else if(x>53147){printf("53149\n");return 0;}
else if(x>53129){printf("53147\n");return 0;}
else if(x>53117){printf("53129\n");return 0;}
else if(x>53113){printf("53117\n");return 0;}
else if(x>53101){printf("53113\n");return 0;}
else if(x>53093){printf("53101\n");return 0;}
else if(x>53089){printf("53093\n");return 0;}
else if(x>53087){printf("53089\n");return 0;}
else if(x>53077){printf("53087\n");return 0;}
else if(x>53069){printf("53077\n");return 0;}
else if(x>53051){printf("53069\n");return 0;}
else if(x>53047){printf("53051\n");return 0;}
else if(x>53017){printf("53047\n");return 0;}
else if(x>53003){printf("53017\n");return 0;}
else if(x>52999){printf("53003\n");return 0;}
else if(x>52981){printf("52999\n");return 0;}
else if(x>52973){printf("52981\n");return 0;}
else if(x>52967){printf("52973\n");return 0;}
else if(x>52963){printf("52967\n");return 0;}
else if(x>52957){printf("52963\n");return 0;}
else if(x>52951){printf("52957\n");return 0;}
else if(x>52937){printf("52951\n");return 0;}
else if(x>52919){printf("52937\n");return 0;}
else if(x>52903){printf("52919\n");return 0;}
else if(x>52901){printf("52903\n");return 0;}
else if(x>52889){printf("52901\n");return 0;}
else if(x>52883){printf("52889\n");return 0;}
else if(x>52879){printf("52883\n");return 0;}
else if(x>52861){printf("52879\n");return 0;}
else if(x>52859){printf("52861\n");return 0;}
else if(x>52837){printf("52859\n");return 0;}
else if(x>52817){printf("52837\n");return 0;}
else if(x>52813){printf("52817\n");return 0;}
else if(x>52807){printf("52813\n");return 0;}
else if(x>52783){printf("52807\n");return 0;}
else if(x>52769){printf("52783\n");return 0;}
else if(x>52757){printf("52769\n");return 0;}
else if(x>52747){printf("52757\n");return 0;}
else if(x>52733){printf("52747\n");return 0;}
else if(x>52727){printf("52733\n");return 0;}
else if(x>52721){printf("52727\n");return 0;}
else if(x>52711){printf("52721\n");return 0;}
else if(x>52709){printf("52711\n");return 0;}
else if(x>52697){printf("52709\n");return 0;}
else if(x>52691){printf("52697\n");return 0;}
else if(x>52673){printf("52691\n");return 0;}
else if(x>52667){printf("52673\n");return 0;}
else if(x>52639){printf("52667\n");return 0;}
else if(x>52631){printf("52639\n");return 0;}
else if(x>52627){printf("52631\n");return 0;}
else if(x>52609){printf("52627\n");return 0;}
else if(x>52583){printf("52609\n");return 0;}
else if(x>52579){printf("52583\n");return 0;}
else if(x>52571){printf("52579\n");return 0;}
else if(x>52567){printf("52571\n");return 0;}
else if(x>52561){printf("52567\n");return 0;}
else if(x>52553){printf("52561\n");return 0;}
else if(x>52543){printf("52553\n");return 0;}
else if(x>52541){printf("52543\n");return 0;}
else if(x>52529){printf("52541\n");return 0;}
else if(x>52517){printf("52529\n");return 0;}
else if(x>52511){printf("52517\n");return 0;}
else if(x>52501){printf("52511\n");return 0;}
else if(x>52489){printf("52501\n");return 0;}
else if(x>52457){printf("52489\n");return 0;}
else if(x>52453){printf("52457\n");return 0;}
else if(x>52433){printf("52453\n");return 0;}
else if(x>52391){printf("52433\n");return 0;}
else if(x>52387){printf("52391\n");return 0;}
else if(x>52379){printf("52387\n");return 0;}
else if(x>52369){printf("52379\n");return 0;}
else if(x>52363){printf("52369\n");return 0;}
else if(x>52361){printf("52363\n");return 0;}
else if(x>52321){printf("52361\n");return 0;}
else if(x>52313){printf("52321\n");return 0;}
else if(x>52301){printf("52313\n");return 0;}
else if(x>52291){printf("52301\n");return 0;}
else if(x>52289){printf("52291\n");return 0;}
else if(x>52267){printf("52289\n");return 0;}
else if(x>52259){printf("52267\n");return 0;}
else if(x>52253){printf("52259\n");return 0;}
else if(x>52249){printf("52253\n");return 0;}
else if(x>52237){printf("52249\n");return 0;}
else if(x>52223){printf("52237\n");return 0;}
else if(x>52201){printf("52223\n");return 0;}
else if(x>52189){printf("52201\n");return 0;}
else if(x>52183){printf("52189\n");return 0;}
else if(x>52181){printf("52183\n");return 0;}
else if(x>52177){printf("52181\n");return 0;}
else if(x>52163){printf("52177\n");return 0;}
else if(x>52153){printf("52163\n");return 0;}
else if(x>52147){printf("52153\n");return 0;}
else if(x>52127){printf("52147\n");return 0;}
else if(x>52121){printf("52127\n");return 0;}
else if(x>52103){printf("52121\n");return 0;}
else if(x>52081){printf("52103\n");return 0;}
else if(x>52069){printf("52081\n");return 0;}
else if(x>52067){printf("52069\n");return 0;}
else if(x>52057){printf("52067\n");return 0;}
else if(x>52051){printf("52057\n");return 0;}
else if(x>52027){printf("52051\n");return 0;}
else if(x>52021){printf("52027\n");return 0;}
else if(x>52009){printf("52021\n");return 0;}
else if(x>51991){printf("52009\n");return 0;}
else if(x>51977){printf("51991\n");return 0;}
else if(x>51973){printf("51977\n");return 0;}
else if(x>51971){printf("51973\n");return 0;}
else if(x>51949){printf("51971\n");return 0;}
else if(x>51941){printf("51949\n");return 0;}
else if(x>51929){printf("51941\n");return 0;}
else if(x>51913){printf("51929\n");return 0;}
else if(x>51907){printf("51913\n");return 0;}
else if(x>51899){printf("51907\n");return 0;}
else if(x>51893){printf("51899\n");return 0;}
else if(x>51871){printf("51893\n");return 0;}
else if(x>51869){printf("51871\n");return 0;}
else if(x>51859){printf("51869\n");return 0;}
else if(x>51853){printf("51859\n");return 0;}
else if(x>51839){printf("51853\n");return 0;}
else if(x>51829){printf("51839\n");return 0;}
else if(x>51827){printf("51829\n");return 0;}
else if(x>51817){printf("51827\n");return 0;}
else if(x>51803){printf("51817\n");return 0;}
else if(x>51797){printf("51803\n");return 0;}
else if(x>51787){printf("51797\n");return 0;}
else if(x>51769){printf("51787\n");return 0;}
else if(x>51767){printf("51769\n");return 0;}
else if(x>51749){printf("51767\n");return 0;}
else if(x>51721){printf("51749\n");return 0;}
else if(x>51719){printf("51721\n");return 0;}
else if(x>51713){printf("51719\n");return 0;}
else if(x>51691){printf("51713\n");return 0;}
else if(x>51683){printf("51691\n");return 0;}
else if(x>51679){printf("51683\n");return 0;}
else if(x>51673){printf("51679\n");return 0;}
else if(x>51659){printf("51673\n");return 0;}
else if(x>51647){printf("51659\n");return 0;}
else if(x>51637){printf("51647\n");return 0;}
else if(x>51631){printf("51637\n");return 0;}
else if(x>51613){printf("51631\n");return 0;}
else if(x>51607){printf("51613\n");return 0;}
else if(x>51599){printf("51607\n");return 0;}
else if(x>51593){printf("51599\n");return 0;}
else if(x>51581){printf("51593\n");return 0;}
else if(x>51577){printf("51581\n");return 0;}
else if(x>51563){printf("51577\n");return 0;}
else if(x>51551){printf("51563\n");return 0;}
else if(x>51539){printf("51551\n");return 0;}
else if(x>51521){printf("51539\n");return 0;}
else if(x>51517){printf("51521\n");return 0;}
else if(x>51511){printf("51517\n");return 0;}
else if(x>51503){printf("51511\n");return 0;}
else if(x>51487){printf("51503\n");return 0;}
else if(x>51481){printf("51487\n");return 0;}
else if(x>51479){printf("51481\n");return 0;}
else if(x>51473){printf("51479\n");return 0;}
else if(x>51461){printf("51473\n");return 0;}
else if(x>51449){printf("51461\n");return 0;}
else if(x>51439){printf("51449\n");return 0;}
else if(x>51437){printf("51439\n");return 0;}
else if(x>51431){printf("51437\n");return 0;}
else if(x>51427){printf("51431\n");return 0;}
else if(x>51421){printf("51427\n");return 0;}
else if(x>51419){printf("51421\n");return 0;}
else if(x>51413){printf("51419\n");return 0;}
else if(x>51407){printf("51413\n");return 0;}
else if(x>51383){printf("51407\n");return 0;}
else if(x>51361){printf("51383\n");return 0;}
else if(x>51349){printf("51361\n");return 0;}
else if(x>51347){printf("51349\n");return 0;}
else if(x>51343){printf("51347\n");return 0;}
else if(x>51341){printf("51343\n");return 0;}
else if(x>51329){printf("51341\n");return 0;}
else if(x>51307){printf("51329\n");return 0;}
else if(x>51287){printf("51307\n");return 0;}
else if(x>51283){printf("51287\n");return 0;}
else if(x>51263){printf("51283\n");return 0;}
else if(x>51257){printf("51263\n");return 0;}
else if(x>51241){printf("51257\n");return 0;}
else if(x>51239){printf("51241\n");return 0;}
else if(x>51229){printf("51239\n");return 0;}
else if(x>51217){printf("51229\n");return 0;}
else if(x>51203){printf("51217\n");return 0;}
else if(x>51199){printf("51203\n");return 0;}
else if(x>51197){printf("51199\n");return 0;}
else if(x>51193){printf("51197\n");return 0;}
else if(x>51169){printf("51193\n");return 0;}
else if(x>51157){printf("51169\n");return 0;}
else if(x>51151){printf("51157\n");return 0;}
else if(x>51137){printf("51151\n");return 0;}
else if(x>51133){printf("51137\n");return 0;}
else if(x>51131){printf("51133\n");return 0;}
else if(x>51109){printf("51131\n");return 0;}
else if(x>51071){printf("51109\n");return 0;}
else if(x>51061){printf("51071\n");return 0;}
else if(x>51059){printf("51061\n");return 0;}
else if(x>51047){printf("51059\n");return 0;}
else if(x>51043){printf("51047\n");return 0;}
else if(x>51031){printf("51043\n");return 0;}
else if(x>51001){printf("51031\n");return 0;}
else if(x>50993){printf("51001\n");return 0;}
else if(x>50989){printf("50993\n");return 0;}
else if(x>50971){printf("50989\n");return 0;}
else if(x>50969){printf("50971\n");return 0;}
else if(x>50957){printf("50969\n");return 0;}
else if(x>50951){printf("50957\n");return 0;}
else if(x>50929){printf("50951\n");return 0;}
else if(x>50923){printf("50929\n");return 0;}
else if(x>50909){printf("50923\n");return 0;}
else if(x>50893){printf("50909\n");return 0;}
else if(x>50891){printf("50893\n");return 0;}
else if(x>50873){printf("50891\n");return 0;}
else if(x>50867){printf("50873\n");return 0;}
else if(x>50857){printf("50867\n");return 0;}
else if(x>50849){printf("50857\n");return 0;}
else if(x>50839){printf("50849\n");return 0;}
else if(x>50833){printf("50839\n");return 0;}
else if(x>50821){printf("50833\n");return 0;}
else if(x>50789){printf("50821\n");return 0;}
else if(x>50777){printf("50789\n");return 0;}
else if(x>50773){printf("50777\n");return 0;}
else if(x>50767){printf("50773\n");return 0;}
else if(x>50753){printf("50767\n");return 0;}
else if(x>50741){printf("50753\n");return 0;}
else if(x>50723){printf("50741\n");return 0;}
else if(x>50707){printf("50723\n");return 0;}
else if(x>50683){printf("50707\n");return 0;}
else if(x>50671){printf("50683\n");return 0;}
else if(x>50651){printf("50671\n");return 0;}
else if(x>50647){printf("50651\n");return 0;}
else if(x>50627){printf("50647\n");return 0;}
else if(x>50599){printf("50627\n");return 0;}
else if(x>50593){printf("50599\n");return 0;}
else if(x>50591){printf("50593\n");return 0;}
else if(x>50587){printf("50591\n");return 0;}
else if(x>50581){printf("50587\n");return 0;}
else if(x>50551){printf("50581\n");return 0;}
else if(x>50549){printf("50551\n");return 0;}
else if(x>50543){printf("50549\n");return 0;}
else if(x>50539){printf("50543\n");return 0;}
else if(x>50527){printf("50539\n");return 0;}
else if(x>50513){printf("50527\n");return 0;}
else if(x>50503){printf("50513\n");return 0;}
else if(x>50497){printf("50503\n");return 0;}
else if(x>50461){printf("50497\n");return 0;}
else if(x>50459){printf("50461\n");return 0;}
else if(x>50441){printf("50459\n");return 0;}
else if(x>50423){printf("50441\n");return 0;}
else if(x>50417){printf("50423\n");return 0;}
else if(x>50411){printf("50417\n");return 0;}
else if(x>50387){printf("50411\n");return 0;}
else if(x>50383){printf("50387\n");return 0;}
else if(x>50377){printf("50383\n");return 0;}
else if(x>50363){printf("50377\n");return 0;}
else if(x>50359){printf("50363\n");return 0;}
else if(x>50341){printf("50359\n");return 0;}
else if(x>50333){printf("50341\n");return 0;}
else if(x>50329){printf("50333\n");return 0;}
else if(x>50321){printf("50329\n");return 0;}
else if(x>50311){printf("50321\n");return 0;}
else if(x>50291){printf("50311\n");return 0;}
else if(x>50287){printf("50291\n");return 0;}
else if(x>50273){printf("50287\n");return 0;}
else if(x>50263){printf("50273\n");return 0;}
else if(x>50261){printf("50263\n");return 0;}
else if(x>50231){printf("50261\n");return 0;}
else if(x>50227){printf("50231\n");return 0;}
else if(x>50221){printf("50227\n");return 0;}
else if(x>50207){printf("50221\n");return 0;}
else if(x>50177){printf("50207\n");return 0;}
else if(x>50159){printf("50177\n");return 0;}
else if(x>50153){printf("50159\n");return 0;}
else if(x>50147){printf("50153\n");return 0;}
else if(x>50131){printf("50147\n");return 0;}
else if(x>50129){printf("50131\n");return 0;}
else if(x>50123){printf("50129\n");return 0;}
else if(x>50119){printf("50123\n");return 0;}
else if(x>50111){printf("50119\n");return 0;}
else if(x>50101){printf("50111\n");return 0;}
else if(x>50093){printf("50101\n");return 0;}
else if(x>50087){printf("50093\n");return 0;}
else if(x>50077){printf("50087\n");return 0;}
else if(x>50069){printf("50077\n");return 0;}
else if(x>50053){printf("50069\n");return 0;}
else if(x>50051){printf("50053\n");return 0;}
else if(x>50047){printf("50051\n");return 0;}
else if(x>50033){printf("50047\n");return 0;}
else if(x>50023){printf("50033\n");return 0;}
else if(x>50021){printf("50023\n");return 0;}
else if(x>49999){printf("50021\n");return 0;}
else if(x>49993){printf("49999\n");return 0;}
else if(x>49991){printf("49993\n");return 0;}
else if(x>49957){printf("49991\n");return 0;}
else if(x>49943){printf("49957\n");return 0;}
else if(x>49939){printf("49943\n");return 0;}
else if(x>49937){printf("49939\n");return 0;}
else if(x>49927){printf("49937\n");return 0;}
else if(x>49921){printf("49927\n");return 0;}
else if(x>49919){printf("49921\n");return 0;}
else if(x>49891){printf("49919\n");return 0;}
else if(x>49877){printf("49891\n");return 0;}
else if(x>49871){printf("49877\n");return 0;}
else if(x>49853){printf("49871\n");return 0;}
else if(x>49843){printf("49853\n");return 0;}
else if(x>49831){printf("49843\n");return 0;}
else if(x>49823){printf("49831\n");return 0;}
else if(x>49811){printf("49823\n");return 0;}
else if(x>49807){printf("49811\n");return 0;}
else if(x>49801){printf("49807\n");return 0;}
else if(x>49789){printf("49801\n");return 0;}
else if(x>49787){printf("49789\n");return 0;}
else if(x>49783){printf("49787\n");return 0;}
else if(x>49757){printf("49783\n");return 0;}
else if(x>49747){printf("49757\n");return 0;}
else if(x>49741){printf("49747\n");return 0;}
else if(x>49739){printf("49741\n");return 0;}
else if(x>49727){printf("49739\n");return 0;}
else if(x>49711){printf("49727\n");return 0;}
else if(x>49697){printf("49711\n");return 0;}
else if(x>49681){printf("49697\n");return 0;}
else if(x>49669){printf("49681\n");return 0;}
else if(x>49667){printf("49669\n");return 0;}
else if(x>49663){printf("49667\n");return 0;}
else if(x>49639){printf("49663\n");return 0;}
else if(x>49633){printf("49639\n");return 0;}
else if(x>49627){printf("49633\n");return 0;}
else if(x>49613){printf("49627\n");return 0;}
else if(x>49603){printf("49613\n");return 0;}
else if(x>49597){printf("49603\n");return 0;}
else if(x>49559){printf("49597\n");return 0;}
else if(x>49549){printf("49559\n");return 0;}
else if(x>49547){printf("49549\n");return 0;}
else if(x>49537){printf("49547\n");return 0;}
else if(x>49531){printf("49537\n");return 0;}
else if(x>49529){printf("49531\n");return 0;}
else if(x>49523){printf("49529\n");return 0;}
else if(x>49499){printf("49523\n");return 0;}
else if(x>49481){printf("49499\n");return 0;}
else if(x>49477){printf("49481\n");return 0;}
else if(x>49463){printf("49477\n");return 0;}
else if(x>49459){printf("49463\n");return 0;}
else if(x>49451){printf("49459\n");return 0;}
else if(x>49433){printf("49451\n");return 0;}
else if(x>49429){printf("49433\n");return 0;}
else if(x>49417){printf("49429\n");return 0;}
else if(x>49411){printf("49417\n");return 0;}
else if(x>49409){printf("49411\n");return 0;}
else if(x>49393){printf("49409\n");return 0;}
else if(x>49391){printf("49393\n");return 0;}
else if(x>49369){printf("49391\n");return 0;}
else if(x>49367){printf("49369\n");return 0;}
else if(x>49363){printf("49367\n");return 0;}
else if(x>49339){printf("49363\n");return 0;}
else if(x>49333){printf("49339\n");return 0;}
else if(x>49331){printf("49333\n");return 0;}
else if(x>49307){printf("49331\n");return 0;}
else if(x>49297){printf("49307\n");return 0;}
else if(x>49279){printf("49297\n");return 0;}
else if(x>49277){printf("49279\n");return 0;}
else if(x>49261){printf("49277\n");return 0;}
else if(x>49253){printf("49261\n");return 0;}
else if(x>49223){printf("49253\n");return 0;}
else if(x>49211){printf("49223\n");return 0;}
else if(x>49207){printf("49211\n");return 0;}
else if(x>49201){printf("49207\n");return 0;}
else if(x>49199){printf("49201\n");return 0;}
else if(x>49193){printf("49199\n");return 0;}
else if(x>49177){printf("49193\n");return 0;}
else if(x>49171){printf("49177\n");return 0;}
else if(x>49169){printf("49171\n");return 0;}
else if(x>49157){printf("49169\n");return 0;}
else if(x>49139){printf("49157\n");return 0;}
else if(x>49123){printf("49139\n");return 0;}
else if(x>49121){printf("49123\n");return 0;}
else if(x>49117){printf("49121\n");return 0;}
else if(x>49109){printf("49117\n");return 0;}
else if(x>49103){printf("49109\n");return 0;}
else if(x>49081){printf("49103\n");return 0;}
else if(x>49069){printf("49081\n");return 0;}
else if(x>49057){printf("49069\n");return 0;}
else if(x>49043){printf("49057\n");return 0;}
else if(x>49037){printf("49043\n");return 0;}
else if(x>49033){printf("49037\n");return 0;}
else if(x>49031){printf("49033\n");return 0;}
else if(x>49019){printf("49031\n");return 0;}
else if(x>49009){printf("49019\n");return 0;}
else if(x>49003){printf("49009\n");return 0;}
else if(x>48991){printf("49003\n");return 0;}
else if(x>48989){printf("48991\n");return 0;}
else if(x>48973){printf("48989\n");return 0;}
else if(x>48953){printf("48973\n");return 0;}
else if(x>48947){printf("48953\n");return 0;}
else if(x>48907){printf("48947\n");return 0;}
else if(x>48889){printf("48907\n");return 0;}
else if(x>48883){printf("48889\n");return 0;}
else if(x>48871){printf("48883\n");return 0;}
else if(x>48869){printf("48871\n");return 0;}
else if(x>48859){printf("48869\n");return 0;}
else if(x>48857){printf("48859\n");return 0;}
else if(x>48847){printf("48857\n");return 0;}
else if(x>48823){printf("48847\n");return 0;}
else if(x>48821){printf("48823\n");return 0;}
else if(x>48817){printf("48821\n");return 0;}
else if(x>48809){printf("48817\n");return 0;}
else if(x>48799){printf("48809\n");return 0;}
else if(x>48787){printf("48799\n");return 0;}
else if(x>48781){printf("48787\n");return 0;}
else if(x>48779){printf("48781\n");return 0;}
else if(x>48767){printf("48779\n");return 0;}
else if(x>48761){printf("48767\n");return 0;}
else if(x>48757){printf("48761\n");return 0;}
else if(x>48751){printf("48757\n");return 0;}
else if(x>48733){printf("48751\n");return 0;}
else if(x>48731){printf("48733\n");return 0;}
else if(x>48679){printf("48731\n");return 0;}
else if(x>48677){printf("48679\n");return 0;}
else if(x>48673){printf("48677\n");return 0;}
else if(x>48661){printf("48673\n");return 0;}
else if(x>48649){printf("48661\n");return 0;}
else if(x>48647){printf("48649\n");return 0;}
else if(x>48623){printf("48647\n");return 0;}
else if(x>48619){printf("48623\n");return 0;}
else if(x>48611){printf("48619\n");return 0;}
else if(x>48593){printf("48611\n");return 0;}
else if(x>48589){printf("48593\n");return 0;}
else if(x>48571){printf("48589\n");return 0;}
else if(x>48563){printf("48571\n");return 0;}
else if(x>48541){printf("48563\n");return 0;}
else if(x>48539){printf("48541\n");return 0;}
else if(x>48533){printf("48539\n");return 0;}
else if(x>48527){printf("48533\n");return 0;}
else if(x>48523){printf("48527\n");return 0;}
else if(x>48497){printf("48523\n");return 0;}
else if(x>48491){printf("48497\n");return 0;}
else if(x>48487){printf("48491\n");return 0;}
else if(x>48481){printf("48487\n");return 0;}
else if(x>48479){printf("48481\n");return 0;}
else if(x>48473){printf("48479\n");return 0;}
else if(x>48463){printf("48473\n");return 0;}
else if(x>48449){printf("48463\n");return 0;}
else if(x>48437){printf("48449\n");return 0;}
else if(x>48413){printf("48437\n");return 0;}
else if(x>48409){printf("48413\n");return 0;}
else if(x>48407){printf("48409\n");return 0;}
else if(x>48397){printf("48407\n");return 0;}
else if(x>48383){printf("48397\n");return 0;}
else if(x>48371){printf("48383\n");return 0;}
else if(x>48353){printf("48371\n");return 0;}
else if(x>48341){printf("48353\n");return 0;}
else if(x>48337){printf("48341\n");return 0;}
else if(x>48313){printf("48337\n");return 0;}
else if(x>48311){printf("48313\n");return 0;}
else if(x>48299){printf("48311\n");return 0;}
else if(x>48281){printf("48299\n");return 0;}
else if(x>48271){printf("48281\n");return 0;}
else if(x>48259){printf("48271\n");return 0;}
else if(x>48247){printf("48259\n");return 0;}
else if(x>48239){printf("48247\n");return 0;}
else if(x>48221){printf("48239\n");return 0;}
else if(x>48197){printf("48221\n");return 0;}
else if(x>48193){printf("48197\n");return 0;}
else if(x>48187){printf("48193\n");return 0;}
else if(x>48179){printf("48187\n");return 0;}
else if(x>48163){printf("48179\n");return 0;}
else if(x>48157){printf("48163\n");return 0;}
else if(x>48131){printf("48157\n");return 0;}
else if(x>48121){printf("48131\n");return 0;}
else if(x>48119){printf("48121\n");return 0;}
else if(x>48109){printf("48119\n");return 0;}
else if(x>48091){printf("48109\n");return 0;}
else if(x>48079){printf("48091\n");return 0;}
else if(x>48073){printf("48079\n");return 0;}
else if(x>48049){printf("48073\n");return 0;}
else if(x>48029){printf("48049\n");return 0;}
else if(x>48023){printf("48029\n");return 0;}
else if(x>48017){printf("48023\n");return 0;}
else if(x>47981){printf("48017\n");return 0;}
else if(x>47977){printf("47981\n");return 0;}
else if(x>47969){printf("47977\n");return 0;}
else if(x>47963){printf("47969\n");return 0;}
else if(x>47951){printf("47963\n");return 0;}
else if(x>47947){printf("47951\n");return 0;}
else if(x>47939){printf("47947\n");return 0;}
else if(x>47933){printf("47939\n");return 0;}
else if(x>47917){printf("47933\n");return 0;}
else if(x>47911){printf("47917\n");return 0;}
else if(x>47903){printf("47911\n");return 0;}
else if(x>47881){printf("47903\n");return 0;}
else if(x>47869){printf("47881\n");return 0;}
else if(x>47857){printf("47869\n");return 0;}
else if(x>47843){printf("47857\n");return 0;}
else if(x>47837){printf("47843\n");return 0;}
else if(x>47819){printf("47837\n");return 0;}
else if(x>47809){printf("47819\n");return 0;}
else if(x>47807){printf("47809\n");return 0;}
else if(x>47797){printf("47807\n");return 0;}
else if(x>47791){printf("47797\n");return 0;}
else if(x>47779){printf("47791\n");return 0;}
else if(x>47777){printf("47779\n");return 0;}
else if(x>47743){printf("47777\n");return 0;}
else if(x>47741){printf("47743\n");return 0;}
else if(x>47737){printf("47741\n");return 0;}
else if(x>47717){printf("47737\n");return 0;}
else if(x>47713){printf("47717\n");return 0;}
else if(x>47711){printf("47713\n");return 0;}
else if(x>47701){printf("47711\n");return 0;}
else if(x>47699){printf("47701\n");return 0;}
else if(x>47681){printf("47699\n");return 0;}
else if(x>47659){printf("47681\n");return 0;}
else if(x>47657){printf("47659\n");return 0;}
else if(x>47653){printf("47657\n");return 0;}
else if(x>47639){printf("47653\n");return 0;}
else if(x>47629){printf("47639\n");return 0;}
else if(x>47623){printf("47629\n");return 0;}
else if(x>47609){printf("47623\n");return 0;}
else if(x>47599){printf("47609\n");return 0;}
else if(x>47591){printf("47599\n");return 0;}
else if(x>47581){printf("47591\n");return 0;}
else if(x>47569){printf("47581\n");return 0;}
else if(x>47563){printf("47569\n");return 0;}
else if(x>47543){printf("47563\n");return 0;}
else if(x>47533){printf("47543\n");return 0;}
else if(x>47527){printf("47533\n");return 0;}
else if(x>47521){printf("47527\n");return 0;}
else if(x>47513){printf("47521\n");return 0;}
else if(x>47507){printf("47513\n");return 0;}
else if(x>47501){printf("47507\n");return 0;}
else if(x>47497){printf("47501\n");return 0;}
else if(x>47491){printf("47497\n");return 0;}
else if(x>47459){printf("47491\n");return 0;}
else if(x>47441){printf("47459\n");return 0;}
else if(x>47431){printf("47441\n");return 0;}
else if(x>47419){printf("47431\n");return 0;}
else if(x>47417){printf("47419\n");return 0;}
else if(x>47407){printf("47417\n");return 0;}
else if(x>47389){printf("47407\n");return 0;}
else if(x>47387){printf("47389\n");return 0;}
else if(x>47381){printf("47387\n");return 0;}
else if(x>47363){printf("47381\n");return 0;}
else if(x>47353){printf("47363\n");return 0;}
else if(x>47351){printf("47353\n");return 0;}
else if(x>47339){printf("47351\n");return 0;}
else if(x>47317){printf("47339\n");return 0;}
else if(x>47309){printf("47317\n");return 0;}
else if(x>47303){printf("47309\n");return 0;}
else if(x>47297){printf("47303\n");return 0;}
else if(x>47293){printf("47297\n");return 0;}
else if(x>47287){printf("47293\n");return 0;}
else if(x>47279){printf("47287\n");return 0;}
else if(x>47269){printf("47279\n");return 0;}
else if(x>47251){printf("47269\n");return 0;}
else if(x>47237){printf("47251\n");return 0;}
else if(x>47221){printf("47237\n");return 0;}
else if(x>47207){printf("47221\n");return 0;}
else if(x>47189){printf("47207\n");return 0;}
else if(x>47161){printf("47189\n");return 0;}
else if(x>47149){printf("47161\n");return 0;}
else if(x>47147){printf("47149\n");return 0;}
else if(x>47143){printf("47147\n");return 0;}
else if(x>47137){printf("47143\n");return 0;}
else if(x>47129){printf("47137\n");return 0;}
else if(x>47123){printf("47129\n");return 0;}
else if(x>47119){printf("47123\n");return 0;}
else if(x>47111){printf("47119\n");return 0;}
else if(x>47093){printf("47111\n");return 0;}
else if(x>47087){printf("47093\n");return 0;}
else if(x>47059){printf("47087\n");return 0;}
else if(x>47057){printf("47059\n");return 0;}
else if(x>47051){printf("47057\n");return 0;}
else if(x>47041){printf("47051\n");return 0;}
else if(x>47017){printf("47041\n");return 0;}
else if(x>46997){printf("47017\n");return 0;}
else if(x>46993){printf("46997\n");return 0;}
else if(x>46957){printf("46993\n");return 0;}
else if(x>46933){printf("46957\n");return 0;}
else if(x>46919){printf("46933\n");return 0;}
else if(x>46901){printf("46919\n");return 0;}
else if(x>46889){printf("46901\n");return 0;}
else if(x>46877){printf("46889\n");return 0;}
else if(x>46867){printf("46877\n");return 0;}
else if(x>46861){printf("46867\n");return 0;}
else if(x>46853){printf("46861\n");return 0;}
else if(x>46831){printf("46853\n");return 0;}
else if(x>46829){printf("46831\n");return 0;}
else if(x>46819){printf("46829\n");return 0;}
else if(x>46817){printf("46819\n");return 0;}
else if(x>46811){printf("46817\n");return 0;}
else if(x>46807){printf("46811\n");return 0;}
else if(x>46771){printf("46807\n");return 0;}
else if(x>46769){printf("46771\n");return 0;}
else if(x>46757){printf("46769\n");return 0;}
else if(x>46751){printf("46757\n");return 0;}
else if(x>46747){printf("46751\n");return 0;}
else if(x>46727){printf("46747\n");return 0;}
else if(x>46723){printf("46727\n");return 0;}
else if(x>46703){printf("46723\n");return 0;}
else if(x>46691){printf("46703\n");return 0;}
else if(x>46687){printf("46691\n");return 0;}
else if(x>46681){printf("46687\n");return 0;}
else if(x>46679){printf("46681\n");return 0;}
else if(x>46663){printf("46679\n");return 0;}
else if(x>46649){printf("46663\n");return 0;}
else if(x>46643){printf("46649\n");return 0;}
else if(x>46639){printf("46643\n");return 0;}
else if(x>46633){printf("46639\n");return 0;}
else if(x>46619){printf("46633\n");return 0;}
else if(x>46601){printf("46619\n");return 0;}
else if(x>46591){printf("46601\n");return 0;}
else if(x>46589){printf("46591\n");return 0;}
else if(x>46573){printf("46589\n");return 0;}
else if(x>46567){printf("46573\n");return 0;}
else if(x>46559){printf("46567\n");return 0;}
else if(x>46549){printf("46559\n");return 0;}
else if(x>46523){printf("46549\n");return 0;}
else if(x>46511){printf("46523\n");return 0;}
else if(x>46507){printf("46511\n");return 0;}
else if(x>46499){printf("46507\n");return 0;}
else if(x>46489){printf("46499\n");return 0;}
else if(x>46477){printf("46489\n");return 0;}
else if(x>46471){printf("46477\n");return 0;}
else if(x>46457){printf("46471\n");return 0;}
else if(x>46451){printf("46457\n");return 0;}
else if(x>46447){printf("46451\n");return 0;}
else if(x>46441){printf("46447\n");return 0;}
else if(x>46439){printf("46441\n");return 0;}
else if(x>46411){printf("46439\n");return 0;}
else if(x>46399){printf("46411\n");return 0;}
else if(x>46381){printf("46399\n");return 0;}
else if(x>46351){printf("46381\n");return 0;}
else if(x>46349){printf("46351\n");return 0;}
else if(x>46337){printf("46349\n");return 0;}
else if(x>46327){printf("46337\n");return 0;}
else if(x>46309){printf("46327\n");return 0;}
else if(x>46307){printf("46309\n");return 0;}
else if(x>46301){printf("46307\n");return 0;}
else if(x>46279){printf("46301\n");return 0;}
else if(x>46273){printf("46279\n");return 0;}
else if(x>46271){printf("46273\n");return 0;}
else if(x>46261){printf("46271\n");return 0;}
else if(x>46237){printf("46261\n");return 0;}
else if(x>46229){printf("46237\n");return 0;}
else if(x>46219){printf("46229\n");return 0;}
else if(x>46199){printf("46219\n");return 0;}
else if(x>46187){printf("46199\n");return 0;}
else if(x>46183){printf("46187\n");return 0;}
else if(x>46181){printf("46183\n");return 0;}
else if(x>46171){printf("46181\n");return 0;}
else if(x>46153){printf("46171\n");return 0;}
else if(x>46147){printf("46153\n");return 0;}
else if(x>46141){printf("46147\n");return 0;}
else if(x>46133){printf("46141\n");return 0;}
else if(x>46103){printf("46133\n");return 0;}
else if(x>46099){printf("46103\n");return 0;}
else if(x>46093){printf("46099\n");return 0;}
else if(x>46091){printf("46093\n");return 0;}
else if(x>46073){printf("46091\n");return 0;}
else if(x>46061){printf("46073\n");return 0;}
else if(x>46051){printf("46061\n");return 0;}
else if(x>46049){printf("46051\n");return 0;}
else if(x>46027){printf("46049\n");return 0;}
else if(x>46021){printf("46027\n");return 0;}
else if(x>45989){printf("46021\n");return 0;}
else if(x>45979){printf("45989\n");return 0;}
else if(x>45971){printf("45979\n");return 0;}
else if(x>45959){printf("45971\n");return 0;}
else if(x>45953){printf("45959\n");return 0;}
else if(x>45949){printf("45953\n");return 0;}
else if(x>45943){printf("45949\n");return 0;}
else if(x>45893){printf("45943\n");return 0;}
else if(x>45887){printf("45893\n");return 0;}
else if(x>45869){printf("45887\n");return 0;}
else if(x>45863){printf("45869\n");return 0;}
else if(x>45853){printf("45863\n");return 0;}
else if(x>45841){printf("45853\n");return 0;}
else if(x>45833){printf("45841\n");return 0;}
else if(x>45827){printf("45833\n");return 0;}
else if(x>45823){printf("45827\n");return 0;}
else if(x>45821){printf("45823\n");return 0;}
else if(x>45817){printf("45821\n");return 0;}
else if(x>45779){printf("45817\n");return 0;}
else if(x>45767){printf("45779\n");return 0;}
else if(x>45763){printf("45767\n");return 0;}
else if(x>45757){printf("45763\n");return 0;}
else if(x>45751){printf("45757\n");return 0;}
else if(x>45737){printf("45751\n");return 0;}
else if(x>45707){printf("45737\n");return 0;}
else if(x>45697){printf("45707\n");return 0;}
else if(x>45691){printf("45697\n");return 0;}
else if(x>45677){printf("45691\n");return 0;}
else if(x>45673){printf("45677\n");return 0;}
else if(x>45667){printf("45673\n");return 0;}
else if(x>45659){printf("45667\n");return 0;}
else if(x>45641){printf("45659\n");return 0;}
else if(x>45631){printf("45641\n");return 0;}
else if(x>45613){printf("45631\n");return 0;}
else if(x>45599){printf("45613\n");return 0;}
else if(x>45589){printf("45599\n");return 0;}
else if(x>45587){printf("45589\n");return 0;}
else if(x>45569){printf("45587\n");return 0;}
else if(x>45557){printf("45569\n");return 0;}
else if(x>45553){printf("45557\n");return 0;}
else if(x>45541){printf("45553\n");return 0;}
else if(x>45533){printf("45541\n");return 0;}
else if(x>45523){printf("45533\n");return 0;}
else if(x>45503){printf("45523\n");return 0;}
else if(x>45497){printf("45503\n");return 0;}
else if(x>45491){printf("45497\n");return 0;}
else if(x>45481){printf("45491\n");return 0;}
else if(x>45439){printf("45481\n");return 0;}
else if(x>45433){printf("45439\n");return 0;}
else if(x>45427){printf("45433\n");return 0;}
else if(x>45413){printf("45427\n");return 0;}
else if(x>45403){printf("45413\n");return 0;}
else if(x>45389){printf("45403\n");return 0;}
else if(x>45377){printf("45389\n");return 0;}
else if(x>45361){printf("45377\n");return 0;}
else if(x>45343){printf("45361\n");return 0;}
else if(x>45341){printf("45343\n");return 0;}
else if(x>45337){printf("45341\n");return 0;}
else if(x>45329){printf("45337\n");return 0;}
else if(x>45319){printf("45329\n");return 0;}
else if(x>45317){printf("45319\n");return 0;}
else if(x>45307){printf("45317\n");return 0;}
else if(x>45293){printf("45307\n");return 0;}
else if(x>45289){printf("45293\n");return 0;}
else if(x>45281){printf("45289\n");return 0;}
else if(x>45263){printf("45281\n");return 0;}
else if(x>45259){printf("45263\n");return 0;}
else if(x>45247){printf("45259\n");return 0;}
else if(x>45233){printf("45247\n");return 0;}
else if(x>45197){printf("45233\n");return 0;}
else if(x>45191){printf("45197\n");return 0;}
else if(x>45181){printf("45191\n");return 0;}
else if(x>45179){printf("45181\n");return 0;}
else if(x>45161){printf("45179\n");return 0;}
else if(x>45139){printf("45161\n");return 0;}
else if(x>45137){printf("45139\n");return 0;}
else if(x>45131){printf("45137\n");return 0;}
else if(x>45127){printf("45131\n");return 0;}
else if(x>45121){printf("45127\n");return 0;}
else if(x>45119){printf("45121\n");return 0;}
else if(x>45083){printf("45119\n");return 0;}
else if(x>45077){printf("45083\n");return 0;}
else if(x>45061){printf("45077\n");return 0;}
else if(x>45053){printf("45061\n");return 0;}
else if(x>45013){printf("45053\n");return 0;}
else if(x>45007){printf("45013\n");return 0;}
else if(x>44987){printf("45007\n");return 0;}
else if(x>44983){printf("44987\n");return 0;}
else if(x>44971){printf("44983\n");return 0;}
else if(x>44963){printf("44971\n");return 0;}
else if(x>44959){printf("44963\n");return 0;}
else if(x>44953){printf("44959\n");return 0;}
else if(x>44939){printf("44953\n");return 0;}
else if(x>44927){printf("44939\n");return 0;}
else if(x>44917){printf("44927\n");return 0;}
else if(x>44909){printf("44917\n");return 0;}
else if(x>44893){printf("44909\n");return 0;}
else if(x>44887){printf("44893\n");return 0;}
else if(x>44879){printf("44887\n");return 0;}
else if(x>44867){printf("44879\n");return 0;}
else if(x>44851){printf("44867\n");return 0;}
else if(x>44843){printf("44851\n");return 0;}
else if(x>44839){printf("44843\n");return 0;}
else if(x>44819){printf("44839\n");return 0;}
else if(x>44809){printf("44819\n");return 0;}
else if(x>44797){printf("44809\n");return 0;}
else if(x>44789){printf("44797\n");return 0;}
else if(x>44777){printf("44789\n");return 0;}
else if(x>44773){printf("44777\n");return 0;}
else if(x>44771){printf("44773\n");return 0;}
else if(x>44753){printf("44771\n");return 0;}
else if(x>44741){printf("44753\n");return 0;}
else if(x>44729){printf("44741\n");return 0;}
else if(x>44711){printf("44729\n");return 0;}
else if(x>44701){printf("44711\n");return 0;}
else if(x>44699){printf("44701\n");return 0;}
else if(x>44687){printf("44699\n");return 0;}
else if(x>44683){printf("44687\n");return 0;}
else if(x>44657){printf("44683\n");return 0;}
else if(x>44651){printf("44657\n");return 0;}
else if(x>44647){printf("44651\n");return 0;}
else if(x>44641){printf("44647\n");return 0;}
else if(x>44633){printf("44641\n");return 0;}
else if(x>44623){printf("44633\n");return 0;}
else if(x>44621){printf("44623\n");return 0;}
else if(x>44617){printf("44621\n");return 0;}
else if(x>44587){printf("44617\n");return 0;}
else if(x>44579){printf("44587\n");return 0;}
else if(x>44563){printf("44579\n");return 0;}
else if(x>44549){printf("44563\n");return 0;}
else if(x>44543){printf("44549\n");return 0;}
else if(x>44537){printf("44543\n");return 0;}
else if(x>44533){printf("44537\n");return 0;}
else if(x>44531){printf("44533\n");return 0;}
else if(x>44519){printf("44531\n");return 0;}
else if(x>44507){printf("44519\n");return 0;}
else if(x>44501){printf("44507\n");return 0;}
else if(x>44497){printf("44501\n");return 0;}
else if(x>44491){printf("44497\n");return 0;}
else if(x>44483){printf("44491\n");return 0;}
else if(x>44453){printf("44483\n");return 0;}
else if(x>44449){printf("44453\n");return 0;}
else if(x>44417){printf("44449\n");return 0;}
else if(x>44389){printf("44417\n");return 0;}
else if(x>44383){printf("44389\n");return 0;}
else if(x>44381){printf("44383\n");return 0;}
else if(x>44371){printf("44381\n");return 0;}
else if(x>44357){printf("44371\n");return 0;}
else if(x>44351){printf("44357\n");return 0;}
else if(x>44293){printf("44351\n");return 0;}
else if(x>44281){printf("44293\n");return 0;}
else if(x>44279){printf("44281\n");return 0;}
else if(x>44273){printf("44279\n");return 0;}
else if(x>44269){printf("44273\n");return 0;}
else if(x>44267){printf("44269\n");return 0;}
else if(x>44263){printf("44267\n");return 0;}
else if(x>44257){printf("44263\n");return 0;}
else if(x>44249){printf("44257\n");return 0;}
else if(x>44221){printf("44249\n");return 0;}
else if(x>44207){printf("44221\n");return 0;}
else if(x>44203){printf("44207\n");return 0;}
else if(x>44201){printf("44203\n");return 0;}
else if(x>44189){printf("44201\n");return 0;}
else if(x>44179){printf("44189\n");return 0;}
else if(x>44171){printf("44179\n");return 0;}
else if(x>44159){printf("44171\n");return 0;}
else if(x>44131){printf("44159\n");return 0;}
else if(x>44129){printf("44131\n");return 0;}
else if(x>44123){printf("44129\n");return 0;}
else if(x>44119){printf("44123\n");return 0;}
else if(x>44111){printf("44119\n");return 0;}
else if(x>44101){printf("44111\n");return 0;}
else if(x>44089){printf("44101\n");return 0;}
else if(x>44087){printf("44089\n");return 0;}
else if(x>44071){printf("44087\n");return 0;}
else if(x>44059){printf("44071\n");return 0;}
else if(x>44053){printf("44059\n");return 0;}
else if(x>44041){printf("44053\n");return 0;}
else if(x>44029){printf("44041\n");return 0;}
else if(x>44027){printf("44029\n");return 0;}
else if(x>44021){printf("44027\n");return 0;}
else if(x>44017){printf("44021\n");return 0;}
else if(x>43997){printf("44017\n");return 0;}
else if(x>43991){printf("43997\n");return 0;}
else if(x>43987){printf("43991\n");return 0;}
else if(x>43973){printf("43987\n");return 0;}
else if(x>43969){printf("43973\n");return 0;}
else if(x>43963){printf("43969\n");return 0;}
else if(x>43961){printf("43963\n");return 0;}
else if(x>43951){printf("43961\n");return 0;}
else if(x>43943){printf("43951\n");return 0;}
else if(x>43933){printf("43943\n");return 0;}
else if(x>43913){printf("43933\n");return 0;}
else if(x>43891){printf("43913\n");return 0;}
else if(x>43889){printf("43891\n");return 0;}
else if(x>43867){printf("43889\n");return 0;}
else if(x>43853){printf("43867\n");return 0;}
else if(x>43801){printf("43853\n");return 0;}
else if(x>43793){printf("43801\n");return 0;}
else if(x>43789){printf("43793\n");return 0;}
else if(x>43787){printf("43789\n");return 0;}
else if(x>43783){printf("43787\n");return 0;}
else if(x>43781){printf("43783\n");return 0;}
else if(x>43777){printf("43781\n");return 0;}
else if(x>43759){printf("43777\n");return 0;}
else if(x>43753){printf("43759\n");return 0;}
else if(x>43721){printf("43753\n");return 0;}
else if(x>43717){printf("43721\n");return 0;}
else if(x>43711){printf("43717\n");return 0;}
else if(x>43691){printf("43711\n");return 0;}
else if(x>43669){printf("43691\n");return 0;}
else if(x>43661){printf("43669\n");return 0;}
else if(x>43651){printf("43661\n");return 0;}
else if(x>43649){printf("43651\n");return 0;}
else if(x>43633){printf("43649\n");return 0;}
else if(x>43627){printf("43633\n");return 0;}
else if(x>43613){printf("43627\n");return 0;}
else if(x>43609){printf("43613\n");return 0;}
else if(x>43607){printf("43609\n");return 0;}
else if(x>43597){printf("43607\n");return 0;}
else if(x>43591){printf("43597\n");return 0;}
else if(x>43579){printf("43591\n");return 0;}
else if(x>43577){printf("43579\n");return 0;}
else if(x>43573){printf("43577\n");return 0;}
else if(x>43543){printf("43573\n");return 0;}
else if(x>43541){printf("43543\n");return 0;}
else if(x>43517){printf("43541\n");return 0;}
else if(x>43499){printf("43517\n");return 0;}
else if(x>43487){printf("43499\n");return 0;}
else if(x>43481){printf("43487\n");return 0;}
else if(x>43457){printf("43481\n");return 0;}
else if(x>43451){printf("43457\n");return 0;}
else if(x>43441){printf("43451\n");return 0;}
else if(x>43427){printf("43441\n");return 0;}
else if(x>43411){printf("43427\n");return 0;}
else if(x>43403){printf("43411\n");return 0;}
else if(x>43399){printf("43403\n");return 0;}
else if(x>43397){printf("43399\n");return 0;}
else if(x>43391){printf("43397\n");return 0;}
else if(x>43331){printf("43391\n");return 0;}
else if(x>43321){printf("43331\n");return 0;}
else if(x>43319){printf("43321\n");return 0;}
else if(x>43313){printf("43319\n");return 0;}
else if(x>43291){printf("43313\n");return 0;}
else if(x>43283){printf("43291\n");return 0;}
else if(x>43271){printf("43283\n");return 0;}
else if(x>43261){printf("43271\n");return 0;}
else if(x>43237){printf("43261\n");return 0;}
else if(x>43223){printf("43237\n");return 0;}
else if(x>43207){printf("43223\n");return 0;}
else if(x>43201){printf("43207\n");return 0;}
else if(x>43189){printf("43201\n");return 0;}
else if(x>43177){printf("43189\n");return 0;}
else if(x>43159){printf("43177\n");return 0;}
else if(x>43151){printf("43159\n");return 0;}
else if(x>43133){printf("43151\n");return 0;}
else if(x>43117){printf("43133\n");return 0;}
else if(x>43103){printf("43117\n");return 0;}
else if(x>43093){printf("43103\n");return 0;}
else if(x>43067){printf("43093\n");return 0;}
else if(x>43063){printf("43067\n");return 0;}
else if(x>43051){printf("43063\n");return 0;}
else if(x>43049){printf("43051\n");return 0;}
else if(x>43037){printf("43049\n");return 0;}
else if(x>43019){printf("43037\n");return 0;}
else if(x>43013){printf("43019\n");return 0;}
else if(x>43003){printf("43013\n");return 0;}
else if(x>42989){printf("43003\n");return 0;}
else if(x>42979){printf("42989\n");return 0;}
else if(x>42967){printf("42979\n");return 0;}
else if(x>42961){printf("42967\n");return 0;}
else if(x>42953){printf("42961\n");return 0;}
else if(x>42943){printf("42953\n");return 0;}
else if(x>42937){printf("42943\n");return 0;}
else if(x>42929){printf("42937\n");return 0;}
else if(x>42923){printf("42929\n");return 0;}
else if(x>42901){printf("42923\n");return 0;}
else if(x>42899){printf("42901\n");return 0;}
else if(x>42863){printf("42899\n");return 0;}
else if(x>42859){printf("42863\n");return 0;}
else if(x>42853){printf("42859\n");return 0;}
else if(x>42841){printf("42853\n");return 0;}
else if(x>42839){printf("42841\n");return 0;}
else if(x>42829){printf("42839\n");return 0;}
else if(x>42821){printf("42829\n");return 0;}
else if(x>42797){printf("42821\n");return 0;}
else if(x>42793){printf("42797\n");return 0;}
else if(x>42787){printf("42793\n");return 0;}
else if(x>42773){printf("42787\n");return 0;}
else if(x>42767){printf("42773\n");return 0;}
else if(x>42751){printf("42767\n");return 0;}
else if(x>42743){printf("42751\n");return 0;}
else if(x>42737){printf("42743\n");return 0;}
else if(x>42727){printf("42737\n");return 0;}
else if(x>42719){printf("42727\n");return 0;}
else if(x>42709){printf("42719\n");return 0;}
else if(x>42703){printf("42709\n");return 0;}
else if(x>42701){printf("42703\n");return 0;}
else if(x>42697){printf("42701\n");return 0;}
else if(x>42689){printf("42697\n");return 0;}
else if(x>42683){printf("42689\n");return 0;}
else if(x>42677){printf("42683\n");return 0;}
else if(x>42667){printf("42677\n");return 0;}
else if(x>42649){printf("42667\n");return 0;}
else if(x>42643){printf("42649\n");return 0;}
else if(x>42641){printf("42643\n");return 0;}
else if(x>42611){printf("42641\n");return 0;}
else if(x>42589){printf("42611\n");return 0;}
else if(x>42577){printf("42589\n");return 0;}
else if(x>42571){printf("42577\n");return 0;}
else if(x>42569){printf("42571\n");return 0;}
else if(x>42557){printf("42569\n");return 0;}
else if(x>42533){printf("42557\n");return 0;}
else if(x>42509){printf("42533\n");return 0;}
else if(x>42499){printf("42509\n");return 0;}
else if(x>42491){printf("42499\n");return 0;}
else if(x>42487){printf("42491\n");return 0;}
else if(x>42473){printf("42487\n");return 0;}
else if(x>42467){printf("42473\n");return 0;}
else if(x>42463){printf("42467\n");return 0;}
else if(x>42461){printf("42463\n");return 0;}
else if(x>42457){printf("42461\n");return 0;}
else if(x>42451){printf("42457\n");return 0;}
else if(x>42443){printf("42451\n");return 0;}
else if(x>42437){printf("42443\n");return 0;}
else if(x>42433){printf("42437\n");return 0;}
else if(x>42409){printf("42433\n");return 0;}
else if(x>42407){printf("42409\n");return 0;}
else if(x>42403){printf("42407\n");return 0;}
else if(x>42397){printf("42403\n");return 0;}
else if(x>42391){printf("42397\n");return 0;}
else if(x>42379){printf("42391\n");return 0;}
else if(x>42373){printf("42379\n");return 0;}
else if(x>42359){printf("42373\n");return 0;}
else if(x>42349){printf("42359\n");return 0;}
else if(x>42337){printf("42349\n");return 0;}
else if(x>42331){printf("42337\n");return 0;}
else if(x>42323){printf("42331\n");return 0;}
else if(x>42307){printf("42323\n");return 0;}
else if(x>42299){printf("42307\n");return 0;}
else if(x>42293){printf("42299\n");return 0;}
else if(x>42283){printf("42293\n");return 0;}
else if(x>42281){printf("42283\n");return 0;}
else if(x>42257){printf("42281\n");return 0;}
else if(x>42239){printf("42257\n");return 0;}
else if(x>42227){printf("42239\n");return 0;}
else if(x>42223){printf("42227\n");return 0;}
else if(x>42221){printf("42223\n");return 0;}
else if(x>42209){printf("42221\n");return 0;}
else if(x>42197){printf("42209\n");return 0;}
else if(x>42193){printf("42197\n");return 0;}
else if(x>42187){printf("42193\n");return 0;}
else if(x>42181){printf("42187\n");return 0;}
else if(x>42179){printf("42181\n");return 0;}
else if(x>42169){printf("42179\n");return 0;}
else if(x>42157){printf("42169\n");return 0;}
else if(x>42139){printf("42157\n");return 0;}
else if(x>42131){printf("42139\n");return 0;}
else if(x>42101){printf("42131\n");return 0;}
else if(x>42089){printf("42101\n");return 0;}
else if(x>42083){printf("42089\n");return 0;}
else if(x>42073){printf("42083\n");return 0;}
else if(x>42071){printf("42073\n");return 0;}
else if(x>42061){printf("42071\n");return 0;}
else if(x>42043){printf("42061\n");return 0;}
else if(x>42023){printf("42043\n");return 0;}
else if(x>42019){printf("42023\n");return 0;}
else if(x>42017){printf("42019\n");return 0;}
else if(x>42013){printf("42017\n");return 0;}
else if(x>41999){printf("42013\n");return 0;}
else if(x>41983){printf("41999\n");return 0;}
else if(x>41981){printf("41983\n");return 0;}
else if(x>41969){printf("41981\n");return 0;}
else if(x>41959){printf("41969\n");return 0;}
else if(x>41957){printf("41959\n");return 0;}
else if(x>41953){printf("41957\n");return 0;}
else if(x>41947){printf("41953\n");return 0;}
else if(x>41941){printf("41947\n");return 0;}
else if(x>41927){printf("41941\n");return 0;}
else if(x>41911){printf("41927\n");return 0;}
else if(x>41903){printf("41911\n");return 0;}
else if(x>41897){printf("41903\n");return 0;}
else if(x>41893){printf("41897\n");return 0;}
else if(x>41887){printf("41893\n");return 0;}
else if(x>41879){printf("41887\n");return 0;}
else if(x>41863){printf("41879\n");return 0;}
else if(x>41851){printf("41863\n");return 0;}
else if(x>41849){printf("41851\n");return 0;}
else if(x>41843){printf("41849\n");return 0;}
else if(x>41813){printf("41843\n");return 0;}
else if(x>41809){printf("41813\n");return 0;}
else if(x>41801){printf("41809\n");return 0;}
else if(x>41777){printf("41801\n");return 0;}
else if(x>41771){printf("41777\n");return 0;}
else if(x>41761){printf("41771\n");return 0;}
else if(x>41759){printf("41761\n");return 0;}
else if(x>41737){printf("41759\n");return 0;}
else if(x>41729){printf("41737\n");return 0;}
else if(x>41719){printf("41729\n");return 0;}
else if(x>41687){printf("41719\n");return 0;}
else if(x>41681){printf("41687\n");return 0;}
else if(x>41669){printf("41681\n");return 0;}
else if(x>41659){printf("41669\n");return 0;}
else if(x>41651){printf("41659\n");return 0;}
else if(x>41647){printf("41651\n");return 0;}
else if(x>41641){printf("41647\n");return 0;}
else if(x>41627){printf("41641\n");return 0;}
else if(x>41621){printf("41627\n");return 0;}
else if(x>41617){printf("41621\n");return 0;}
else if(x>41611){printf("41617\n");return 0;}
else if(x>41609){printf("41611\n");return 0;}
else if(x>41603){printf("41609\n");return 0;}
else if(x>41597){printf("41603\n");return 0;}
else if(x>41593){printf("41597\n");return 0;}
else if(x>41579){printf("41593\n");return 0;}
else if(x>41549){printf("41579\n");return 0;}
else if(x>41543){printf("41549\n");return 0;}
else if(x>41539){printf("41543\n");return 0;}
else if(x>41521){printf("41539\n");return 0;}
else if(x>41519){printf("41521\n");return 0;}
else if(x>41513){printf("41519\n");return 0;}
else if(x>41507){printf("41513\n");return 0;}
else if(x>41491){printf("41507\n");return 0;}
else if(x>41479){printf("41491\n");return 0;}
else if(x>41467){printf("41479\n");return 0;}
else if(x>41453){printf("41467\n");return 0;}
else if(x>41443){printf("41453\n");return 0;}
else if(x>41413){printf("41443\n");return 0;}
else if(x>41411){printf("41413\n");return 0;}
else if(x>41399){printf("41411\n");return 0;}
else if(x>41389){printf("41399\n");return 0;}
else if(x>41387){printf("41389\n");return 0;}
else if(x>41381){printf("41387\n");return 0;}
else if(x>41357){printf("41381\n");return 0;}
else if(x>41351){printf("41357\n");return 0;}
else if(x>41341){printf("41351\n");return 0;}
else if(x>41333){printf("41341\n");return 0;}
else if(x>41299){printf("41333\n");return 0;}
else if(x>41281){printf("41299\n");return 0;}
else if(x>41269){printf("41281\n");return 0;}
else if(x>41263){printf("41269\n");return 0;}
else if(x>41257){printf("41263\n");return 0;}
else if(x>41243){printf("41257\n");return 0;}
else if(x>41233){printf("41243\n");return 0;}
else if(x>41231){printf("41233\n");return 0;}
else if(x>41227){printf("41231\n");return 0;}
else if(x>41221){printf("41227\n");return 0;}
else if(x>41213){printf("41221\n");return 0;}
else if(x>41203){printf("41213\n");return 0;}
else if(x>41201){printf("41203\n");return 0;}
else if(x>41189){printf("41201\n");return 0;}
else if(x>41183){printf("41189\n");return 0;}
else if(x>41179){printf("41183\n");return 0;}
else if(x>41177){printf("41179\n");return 0;}
else if(x>41161){printf("41177\n");return 0;}
else if(x>41149){printf("41161\n");return 0;}
else if(x>41143){printf("41149\n");return 0;}
else if(x>41141){printf("41143\n");return 0;}
else if(x>41131){printf("41141\n");return 0;}
else if(x>41117){printf("41131\n");return 0;}
else if(x>41113){printf("41117\n");return 0;}
else if(x>41081){printf("41113\n");return 0;}
else if(x>41077){printf("41081\n");return 0;}
else if(x>41057){printf("41077\n");return 0;}
else if(x>41051){printf("41057\n");return 0;}
else if(x>41047){printf("41051\n");return 0;}
else if(x>41039){printf("41047\n");return 0;}
else if(x>41023){printf("41039\n");return 0;}
else if(x>41017){printf("41023\n");return 0;}
else if(x>41011){printf("41017\n");return 0;}
else if(x>40993){printf("41011\n");return 0;}
else if(x>40973){printf("40993\n");return 0;}
else if(x>40961){printf("40973\n");return 0;}
else if(x>40949){printf("40961\n");return 0;}
else if(x>40939){printf("40949\n");return 0;}
else if(x>40933){printf("40939\n");return 0;}
else if(x>40927){printf("40933\n");return 0;}
else if(x>40903){printf("40927\n");return 0;}
else if(x>40897){printf("40903\n");return 0;}
else if(x>40883){printf("40897\n");return 0;}
else if(x>40879){printf("40883\n");return 0;}
else if(x>40867){printf("40879\n");return 0;}
else if(x>40853){printf("40867\n");return 0;}
else if(x>40849){printf("40853\n");return 0;}
else if(x>40847){printf("40849\n");return 0;}
else if(x>40841){printf("40847\n");return 0;}
else if(x>40829){printf("40841\n");return 0;}
else if(x>40823){printf("40829\n");return 0;}
else if(x>40819){printf("40823\n");return 0;}
else if(x>40813){printf("40819\n");return 0;}
else if(x>40801){printf("40813\n");return 0;}
else if(x>40787){printf("40801\n");return 0;}
else if(x>40771){printf("40787\n");return 0;}
else if(x>40763){printf("40771\n");return 0;}
else if(x>40759){printf("40763\n");return 0;}
else if(x>40751){printf("40759\n");return 0;}
else if(x>40739){printf("40751\n");return 0;}
else if(x>40709){printf("40739\n");return 0;}
else if(x>40699){printf("40709\n");return 0;}
else if(x>40697){printf("40699\n");return 0;}
else if(x>40693){printf("40697\n");return 0;}
else if(x>40639){printf("40693\n");return 0;}
else if(x>40637){printf("40639\n");return 0;}
else if(x>40627){printf("40637\n");return 0;}
else if(x>40609){printf("40627\n");return 0;}
else if(x>40597){printf("40609\n");return 0;}
else if(x>40591){printf("40597\n");return 0;}
else if(x>40583){printf("40591\n");return 0;}
else if(x>40577){printf("40583\n");return 0;}
else if(x>40559){printf("40577\n");return 0;}
else if(x>40543){printf("40559\n");return 0;}
else if(x>40531){printf("40543\n");return 0;}
else if(x>40529){printf("40531\n");return 0;}
else if(x>40519){printf("40529\n");return 0;}
else if(x>40507){printf("40519\n");return 0;}
else if(x>40499){printf("40507\n");return 0;}
else if(x>40493){printf("40499\n");return 0;}
else if(x>40487){printf("40493\n");return 0;}
else if(x>40483){printf("40487\n");return 0;}
else if(x>40471){printf("40483\n");return 0;}
else if(x>40459){printf("40471\n");return 0;}
else if(x>40433){printf("40459\n");return 0;}
else if(x>40429){printf("40433\n");return 0;}
else if(x>40427){printf("40429\n");return 0;}
else if(x>40423){printf("40427\n");return 0;}
else if(x>40387){printf("40423\n");return 0;}
else if(x>40361){printf("40387\n");return 0;}
else if(x>40357){printf("40361\n");return 0;}
else if(x>40351){printf("40357\n");return 0;}
else if(x>40343){printf("40351\n");return 0;}
else if(x>40289){printf("40343\n");return 0;}
else if(x>40283){printf("40289\n");return 0;}
else if(x>40277){printf("40283\n");return 0;}
else if(x>40253){printf("40277\n");return 0;}
else if(x>40241){printf("40253\n");return 0;}
else if(x>40237){printf("40241\n");return 0;}
else if(x>40231){printf("40237\n");return 0;}
else if(x>40213){printf("40231\n");return 0;}
else if(x>40193){printf("40213\n");return 0;}
else if(x>40189){printf("40193\n");return 0;}
else if(x>40177){printf("40189\n");return 0;}
else if(x>40169){printf("40177\n");return 0;}
else if(x>40163){printf("40169\n");return 0;}
else if(x>40153){printf("40163\n");return 0;}
else if(x>40151){printf("40153\n");return 0;}
else if(x>40129){printf("40151\n");return 0;}
else if(x>40127){printf("40129\n");return 0;}
else if(x>40123){printf("40127\n");return 0;}
else if(x>40111){printf("40123\n");return 0;}
else if(x>40099){printf("40111\n");return 0;}
else if(x>40093){printf("40099\n");return 0;}
else if(x>40087){printf("40093\n");return 0;}
else if(x>40063){printf("40087\n");return 0;}
else if(x>40039){printf("40063\n");return 0;}
else if(x>40037){printf("40039\n");return 0;}
else if(x>40031){printf("40037\n");return 0;}
else if(x>40013){printf("40031\n");return 0;}
else if(x>40009){printf("40013\n");return 0;}
else if(x>39989){printf("40009\n");return 0;}
else if(x>39983){printf("39989\n");return 0;}
else if(x>39979){printf("39983\n");return 0;}
else if(x>39971){printf("39979\n");return 0;}
else if(x>39953){printf("39971\n");return 0;}
else if(x>39937){printf("39953\n");return 0;}
else if(x>39929){printf("39937\n");return 0;}
else if(x>39901){printf("39929\n");return 0;}
else if(x>39887){printf("39901\n");return 0;}
else if(x>39883){printf("39887\n");return 0;}
else if(x>39877){printf("39883\n");return 0;}
else if(x>39869){printf("39877\n");return 0;}
else if(x>39863){printf("39869\n");return 0;}
else if(x>39857){printf("39863\n");return 0;}
else if(x>39847){printf("39857\n");return 0;}
else if(x>39841){printf("39847\n");return 0;}
else if(x>39839){printf("39841\n");return 0;}
else if(x>39829){printf("39839\n");return 0;}
else if(x>39827){printf("39829\n");return 0;}
else if(x>39821){printf("39827\n");return 0;}
else if(x>39799){printf("39821\n");return 0;}
else if(x>39791){printf("39799\n");return 0;}
else if(x>39779){printf("39791\n");return 0;}
else if(x>39769){printf("39779\n");return 0;}
else if(x>39761){printf("39769\n");return 0;}
else if(x>39749){printf("39761\n");return 0;}
else if(x>39733){printf("39749\n");return 0;}
else if(x>39727){printf("39733\n");return 0;}
else if(x>39719){printf("39727\n");return 0;}
else if(x>39709){printf("39719\n");return 0;}
else if(x>39703){printf("39709\n");return 0;}
else if(x>39679){printf("39703\n");return 0;}
else if(x>39671){printf("39679\n");return 0;}
else if(x>39667){printf("39671\n");return 0;}
else if(x>39659){printf("39667\n");return 0;}
else if(x>39631){printf("39659\n");return 0;}
else if(x>39623){printf("39631\n");return 0;}
else if(x>39619){printf("39623\n");return 0;}
else if(x>39607){printf("39619\n");return 0;}
else if(x>39581){printf("39607\n");return 0;}
else if(x>39569){printf("39581\n");return 0;}
else if(x>39563){printf("39569\n");return 0;}
else if(x>39551){printf("39563\n");return 0;}
else if(x>39541){printf("39551\n");return 0;}
else if(x>39521){printf("39541\n");return 0;}
else if(x>39511){printf("39521\n");return 0;}
else if(x>39509){printf("39511\n");return 0;}
else if(x>39503){printf("39509\n");return 0;}
else if(x>39499){printf("39503\n");return 0;}
else if(x>39461){printf("39499\n");return 0;}
else if(x>39451){printf("39461\n");return 0;}
else if(x>39443){printf("39451\n");return 0;}
else if(x>39439){printf("39443\n");return 0;}
else if(x>39419){printf("39439\n");return 0;}
else if(x>39409){printf("39419\n");return 0;}
else if(x>39397){printf("39409\n");return 0;}
else if(x>39383){printf("39397\n");return 0;}
else if(x>39373){printf("39383\n");return 0;}
else if(x>39371){printf("39373\n");return 0;}
else if(x>39367){printf("39371\n");return 0;}
else if(x>39359){printf("39367\n");return 0;}
else if(x>39343){printf("39359\n");return 0;}
else if(x>39341){printf("39343\n");return 0;}
else if(x>39323){printf("39341\n");return 0;}
else if(x>39317){printf("39323\n");return 0;}
else if(x>39313){printf("39317\n");return 0;}
else if(x>39301){printf("39313\n");return 0;}
else if(x>39293){printf("39301\n");return 0;}
else if(x>39251){printf("39293\n");return 0;}
else if(x>39241){printf("39251\n");return 0;}
else if(x>39239){printf("39241\n");return 0;}
else if(x>39233){printf("39239\n");return 0;}
else if(x>39229){printf("39233\n");return 0;}
else if(x>39227){printf("39229\n");return 0;}
else if(x>39217){printf("39227\n");return 0;}
else if(x>39209){printf("39217\n");return 0;}
else if(x>39199){printf("39209\n");return 0;}
else if(x>39191){printf("39199\n");return 0;}
else if(x>39181){printf("39191\n");return 0;}
else if(x>39163){printf("39181\n");return 0;}
else if(x>39161){printf("39163\n");return 0;}
else if(x>39157){printf("39161\n");return 0;}
else if(x>39139){printf("39157\n");return 0;}
else if(x>39133){printf("39139\n");return 0;}
else if(x>39119){printf("39133\n");return 0;}
else if(x>39113){printf("39119\n");return 0;}
else if(x>39107){printf("39113\n");return 0;}
else if(x>39103){printf("39107\n");return 0;}
else if(x>39097){printf("39103\n");return 0;}
else if(x>39089){printf("39097\n");return 0;}
else if(x>39079){printf("39089\n");return 0;}
else if(x>39047){printf("39079\n");return 0;}
else if(x>39043){printf("39047\n");return 0;}
else if(x>39041){printf("39043\n");return 0;}
else if(x>39023){printf("39041\n");return 0;}
else if(x>39019){printf("39023\n");return 0;}
else if(x>38993){printf("39019\n");return 0;}
else if(x>38977){printf("38993\n");return 0;}
else if(x>38971){printf("38977\n");return 0;}
else if(x>38959){printf("38971\n");return 0;}
else if(x>38953){printf("38959\n");return 0;}
else if(x>38933){printf("38953\n");return 0;}
else if(x>38923){printf("38933\n");return 0;}
else if(x>38921){printf("38923\n");return 0;}
else if(x>38917){printf("38921\n");return 0;}
else if(x>38903){printf("38917\n");return 0;}
else if(x>38891){printf("38903\n");return 0;}
else if(x>38873){printf("38891\n");return 0;}
else if(x>38867){printf("38873\n");return 0;}
else if(x>38861){printf("38867\n");return 0;}
else if(x>38851){printf("38861\n");return 0;}
else if(x>38839){printf("38851\n");return 0;}
else if(x>38833){printf("38839\n");return 0;}
else if(x>38821){printf("38833\n");return 0;}
else if(x>38803){printf("38821\n");return 0;}
else if(x>38791){printf("38803\n");return 0;}
else if(x>38783){printf("38791\n");return 0;}
else if(x>38767){printf("38783\n");return 0;}
else if(x>38749){printf("38767\n");return 0;}
else if(x>38747){printf("38749\n");return 0;}
else if(x>38737){printf("38747\n");return 0;}
else if(x>38729){printf("38737\n");return 0;}
else if(x>38723){printf("38729\n");return 0;}
else if(x>38713){printf("38723\n");return 0;}
else if(x>38711){printf("38713\n");return 0;}
else if(x>38707){printf("38711\n");return 0;}
else if(x>38699){printf("38707\n");return 0;}
else if(x>38693){printf("38699\n");return 0;}
else if(x>38677){printf("38693\n");return 0;}
else if(x>38671){printf("38677\n");return 0;}
else if(x>38669){printf("38671\n");return 0;}
else if(x>38653){printf("38669\n");return 0;}
else if(x>38651){printf("38653\n");return 0;}
else if(x>38639){printf("38651\n");return 0;}
else if(x>38629){printf("38639\n");return 0;}
else if(x>38611){printf("38629\n");return 0;}
else if(x>38609){printf("38611\n");return 0;}
else if(x>38603){printf("38609\n");return 0;}
else if(x>38593){printf("38603\n");return 0;}
else if(x>38569){printf("38593\n");return 0;}
else if(x>38567){printf("38569\n");return 0;}
else if(x>38561){printf("38567\n");return 0;}
else if(x>38557){printf("38561\n");return 0;}
else if(x>38543){printf("38557\n");return 0;}
else if(x>38501){printf("38543\n");return 0;}
else if(x>38461){printf("38501\n");return 0;}
else if(x>38459){printf("38461\n");return 0;}
else if(x>38453){printf("38459\n");return 0;}
else if(x>38449){printf("38453\n");return 0;}
else if(x>38447){printf("38449\n");return 0;}
else if(x>38431){printf("38447\n");return 0;}
else if(x>38393){printf("38431\n");return 0;}
else if(x>38377){printf("38393\n");return 0;}
else if(x>38371){printf("38377\n");return 0;}
else if(x>38351){printf("38371\n");return 0;}
else if(x>38333){printf("38351\n");return 0;}
else if(x>38329){printf("38333\n");return 0;}
else if(x>38327){printf("38329\n");return 0;}
else if(x>38321){printf("38327\n");return 0;}
else if(x>38317){printf("38321\n");return 0;}
else if(x>38303){printf("38317\n");return 0;}
else if(x>38299){printf("38303\n");return 0;}
else if(x>38287){printf("38299\n");return 0;}
else if(x>38281){printf("38287\n");return 0;}
else if(x>38273){printf("38281\n");return 0;}
else if(x>38261){printf("38273\n");return 0;}
else if(x>38239){printf("38261\n");return 0;}
else if(x>38237){printf("38239\n");return 0;}
else if(x>38231){printf("38237\n");return 0;}
else if(x>38219){printf("38231\n");return 0;}
else if(x>38201){printf("38219\n");return 0;}
else if(x>38197){printf("38201\n");return 0;}
else if(x>38189){printf("38197\n");return 0;}
else if(x>38183){printf("38189\n");return 0;}
else if(x>38177){printf("38183\n");return 0;}
else if(x>38167){printf("38177\n");return 0;}
else if(x>38153){printf("38167\n");return 0;}
else if(x>38149){printf("38153\n");return 0;}
else if(x>38119){printf("38149\n");return 0;}
else if(x>38113){printf("38119\n");return 0;}
else if(x>38083){printf("38113\n");return 0;}
else if(x>38069){printf("38083\n");return 0;}
else if(x>38053){printf("38069\n");return 0;}
else if(x>38047){printf("38053\n");return 0;}
else if(x>38039){printf("38047\n");return 0;}
else if(x>38011){printf("38039\n");return 0;}
else if(x>37997){printf("38011\n");return 0;}
else if(x>37993){printf("37997\n");return 0;}
else if(x>37991){printf("37993\n");return 0;}
else if(x>37987){printf("37991\n");return 0;}
else if(x>37967){printf("37987\n");return 0;}
else if(x>37963){printf("37967\n");return 0;}
else if(x>37957){printf("37963\n");return 0;}
else if(x>37951){printf("37957\n");return 0;}
else if(x>37907){printf("37951\n");return 0;}
else if(x>37897){printf("37907\n");return 0;}
else if(x>37889){printf("37897\n");return 0;}
else if(x>37879){printf("37889\n");return 0;}
else if(x>37871){printf("37879\n");return 0;}
else if(x>37861){printf("37871\n");return 0;}
else if(x>37853){printf("37861\n");return 0;}
else if(x>37847){printf("37853\n");return 0;}
else if(x>37831){printf("37847\n");return 0;}
else if(x>37813){printf("37831\n");return 0;}
else if(x>37811){printf("37813\n");return 0;}
else if(x>37799){printf("37811\n");return 0;}
else if(x>37783){printf("37799\n");return 0;}
else if(x>37781){printf("37783\n");return 0;}
else if(x>37747){printf("37781\n");return 0;}
else if(x>37717){printf("37747\n");return 0;}
else if(x>37699){printf("37717\n");return 0;}
else if(x>37693){printf("37699\n");return 0;}
else if(x>37691){printf("37693\n");return 0;}
else if(x>37663){printf("37691\n");return 0;}
else if(x>37657){printf("37663\n");return 0;}
else if(x>37649){printf("37657\n");return 0;}
else if(x>37643){printf("37649\n");return 0;}
else if(x>37633){printf("37643\n");return 0;}
else if(x>37619){printf("37633\n");return 0;}
else if(x>37607){printf("37619\n");return 0;}
else if(x>37591){printf("37607\n");return 0;}
else if(x>37589){printf("37591\n");return 0;}
else if(x>37579){printf("37589\n");return 0;}
else if(x>37573){printf("37579\n");return 0;}
else if(x>37571){printf("37573\n");return 0;}
else if(x>37567){printf("37571\n");return 0;}
else if(x>37561){printf("37567\n");return 0;}
else if(x>37549){printf("37561\n");return 0;}
else if(x>37547){printf("37549\n");return 0;}
else if(x>37537){printf("37547\n");return 0;}
else if(x>37529){printf("37537\n");return 0;}
else if(x>37517){printf("37529\n");return 0;}
else if(x>37511){printf("37517\n");return 0;}
else if(x>37507){printf("37511\n");return 0;}
else if(x>37501){printf("37507\n");return 0;}
else if(x>37493){printf("37501\n");return 0;}
else if(x>37489){printf("37493\n");return 0;}
else if(x>37483){printf("37489\n");return 0;}
else if(x>37463){printf("37483\n");return 0;}
else if(x>37447){printf("37463\n");return 0;}
else if(x>37441){printf("37447\n");return 0;}
else if(x>37423){printf("37441\n");return 0;}
else if(x>37409){printf("37423\n");return 0;}
else if(x>37397){printf("37409\n");return 0;}
else if(x>37379){printf("37397\n");return 0;}
else if(x>37369){printf("37379\n");return 0;}
else if(x>37363){printf("37369\n");return 0;}
else if(x>37361){printf("37363\n");return 0;}
else if(x>37357){printf("37361\n");return 0;}
else if(x>37339){printf("37357\n");return 0;}
else if(x>37337){printf("37339\n");return 0;}
else if(x>37321){printf("37337\n");return 0;}
else if(x>37313){printf("37321\n");return 0;}
else if(x>37309){printf("37313\n");return 0;}
else if(x>37307){printf("37309\n");return 0;}
else if(x>37277){printf("37307\n");return 0;}
else if(x>37273){printf("37277\n");return 0;}
else if(x>37253){printf("37273\n");return 0;}
else if(x>37243){printf("37253\n");return 0;}
else if(x>37223){printf("37243\n");return 0;}
else if(x>37217){printf("37223\n");return 0;}
else if(x>37201){printf("37217\n");return 0;}
else if(x>37199){printf("37201\n");return 0;}
else if(x>37189){printf("37199\n");return 0;}
else if(x>37181){printf("37189\n");return 0;}
else if(x>37171){printf("37181\n");return 0;}
else if(x>37159){printf("37171\n");return 0;}
else if(x>37139){printf("37159\n");return 0;}
else if(x>37123){printf("37139\n");return 0;}
else if(x>37117){printf("37123\n");return 0;}
else if(x>37097){printf("37117\n");return 0;}
else if(x>37087){printf("37097\n");return 0;}
else if(x>37061){printf("37087\n");return 0;}
else if(x>37057){printf("37061\n");return 0;}
else if(x>37049){printf("37057\n");return 0;}
else if(x>37039){printf("37049\n");return 0;}
else if(x>37021){printf("37039\n");return 0;}
else if(x>37019){printf("37021\n");return 0;}
else if(x>37013){printf("37019\n");return 0;}
else if(x>37003){printf("37013\n");return 0;}
else if(x>36997){printf("37003\n");return 0;}
else if(x>36979){printf("36997\n");return 0;}
else if(x>36973){printf("36979\n");return 0;}
else if(x>36947){printf("36973\n");return 0;}
else if(x>36943){printf("36947\n");return 0;}
else if(x>36931){printf("36943\n");return 0;}
else if(x>36929){printf("36931\n");return 0;}
else if(x>36923){printf("36929\n");return 0;}
else if(x>36919){printf("36923\n");return 0;}
else if(x>36913){printf("36919\n");return 0;}
else if(x>36901){printf("36913\n");return 0;}
else if(x>36899){printf("36901\n");return 0;}
else if(x>36887){printf("36899\n");return 0;}
else if(x>36877){printf("36887\n");return 0;}
else if(x>36871){printf("36877\n");return 0;}
else if(x>36857){printf("36871\n");return 0;}
else if(x>36847){printf("36857\n");return 0;}
else if(x>36833){printf("36847\n");return 0;}
else if(x>36821){printf("36833\n");return 0;}
else if(x>36809){printf("36821\n");return 0;}
else if(x>36793){printf("36809\n");return 0;}
else if(x>36791){printf("36793\n");return 0;}
else if(x>36787){printf("36791\n");return 0;}
else if(x>36781){printf("36787\n");return 0;}
else if(x>36779){printf("36781\n");return 0;}
else if(x>36767){printf("36779\n");return 0;}
else if(x>36761){printf("36767\n");return 0;}
else if(x>36749){printf("36761\n");return 0;}
else if(x>36739){printf("36749\n");return 0;}
else if(x>36721){printf("36739\n");return 0;}
else if(x>36713){printf("36721\n");return 0;}
else if(x>36709){printf("36713\n");return 0;}
else if(x>36697){printf("36709\n");return 0;}
else if(x>36691){printf("36697\n");return 0;}
else if(x>36683){printf("36691\n");return 0;}
else if(x>36677){printf("36683\n");return 0;}
else if(x>36671){printf("36677\n");return 0;}
else if(x>36653){printf("36671\n");return 0;}
else if(x>36643){printf("36653\n");return 0;}
else if(x>36637){printf("36643\n");return 0;}
else if(x>36629){printf("36637\n");return 0;}
else if(x>36607){printf("36629\n");return 0;}
else if(x>36599){printf("36607\n");return 0;}
else if(x>36587){printf("36599\n");return 0;}
else if(x>36583){printf("36587\n");return 0;}
else if(x>36571){printf("36583\n");return 0;}
else if(x>36563){printf("36571\n");return 0;}
else if(x>36559){printf("36563\n");return 0;}
else if(x>36551){printf("36559\n");return 0;}
else if(x>36541){printf("36551\n");return 0;}
else if(x>36529){printf("36541\n");return 0;}
else if(x>36527){printf("36529\n");return 0;}
else if(x>36523){printf("36527\n");return 0;}
else if(x>36497){printf("36523\n");return 0;}
else if(x>36493){printf("36497\n");return 0;}
else if(x>36479){printf("36493\n");return 0;}
else if(x>36473){printf("36479\n");return 0;}
else if(x>36469){printf("36473\n");return 0;}
else if(x>36467){printf("36469\n");return 0;}
else if(x>36457){printf("36467\n");return 0;}
else if(x>36451){printf("36457\n");return 0;}
else if(x>36433){printf("36451\n");return 0;}
else if(x>36389){printf("36433\n");return 0;}
else if(x>36383){printf("36389\n");return 0;}
else if(x>36373){printf("36383\n");return 0;}
else if(x>36353){printf("36373\n");return 0;}
else if(x>36343){printf("36353\n");return 0;}
else if(x>36341){printf("36343\n");return 0;}
else if(x>36319){printf("36341\n");return 0;}
else if(x>36313){printf("36319\n");return 0;}
else if(x>36307){printf("36313\n");return 0;}
else if(x>36299){printf("36307\n");return 0;}
else if(x>36293){printf("36299\n");return 0;}
else if(x>36277){printf("36293\n");return 0;}
else if(x>36269){printf("36277\n");return 0;}
else if(x>36263){printf("36269\n");return 0;}
else if(x>36251){printf("36263\n");return 0;}
else if(x>36241){printf("36251\n");return 0;}
else if(x>36229){printf("36241\n");return 0;}
else if(x>36217){printf("36229\n");return 0;}
else if(x>36209){printf("36217\n");return 0;}
else if(x>36191){printf("36209\n");return 0;}
else if(x>36187){printf("36191\n");return 0;}
else if(x>36161){printf("36187\n");return 0;}
else if(x>36151){printf("36161\n");return 0;}
else if(x>36137){printf("36151\n");return 0;}
else if(x>36131){printf("36137\n");return 0;}
else if(x>36109){printf("36131\n");return 0;}
else if(x>36107){printf("36109\n");return 0;}
else if(x>36097){printf("36107\n");return 0;}
else if(x>36083){printf("36097\n");return 0;}
else if(x>36073){printf("36083\n");return 0;}
else if(x>36067){printf("36073\n");return 0;}
else if(x>36061){printf("36067\n");return 0;}
else if(x>36037){printf("36061\n");return 0;}
else if(x>36017){printf("36037\n");return 0;}
else if(x>36013){printf("36017\n");return 0;}
else if(x>36011){printf("36013\n");return 0;}
else if(x>36007){printf("36011\n");return 0;}
else if(x>35999){printf("36007\n");return 0;}
else if(x>35993){printf("35999\n");return 0;}
else if(x>35983){printf("35993\n");return 0;}
else if(x>35977){printf("35983\n");return 0;}
else if(x>35969){printf("35977\n");return 0;}
else if(x>35963){printf("35969\n");return 0;}
else if(x>35951){printf("35963\n");return 0;}
else if(x>35933){printf("35951\n");return 0;}
else if(x>35923){printf("35933\n");return 0;}
else if(x>35911){printf("35923\n");return 0;}
else if(x>35899){printf("35911\n");return 0;}
else if(x>35897){printf("35899\n");return 0;}
else if(x>35879){printf("35897\n");return 0;}
else if(x>35869){printf("35879\n");return 0;}
else if(x>35863){printf("35869\n");return 0;}
else if(x>35851){printf("35863\n");return 0;}
else if(x>35839){printf("35851\n");return 0;}
else if(x>35837){printf("35839\n");return 0;}
else if(x>35831){printf("35837\n");return 0;}
else if(x>35809){printf("35831\n");return 0;}
else if(x>35803){printf("35809\n");return 0;}
else if(x>35801){printf("35803\n");return 0;}
else if(x>35797){printf("35801\n");return 0;}
else if(x>35771){printf("35797\n");return 0;}
else if(x>35759){printf("35771\n");return 0;}
else if(x>35753){printf("35759\n");return 0;}
else if(x>35747){printf("35753\n");return 0;}
else if(x>35731){printf("35747\n");return 0;}
else if(x>35729){printf("35731\n");return 0;}
else if(x>35677){printf("35729\n");return 0;}
else if(x>35671){printf("35677\n");return 0;}
else if(x>35617){printf("35671\n");return 0;}
else if(x>35603){printf("35617\n");return 0;}
else if(x>35597){printf("35603\n");return 0;}
else if(x>35593){printf("35597\n");return 0;}
else if(x>35591){printf("35593\n");return 0;}
else if(x>35573){printf("35591\n");return 0;}
else if(x>35569){printf("35573\n");return 0;}
else if(x>35543){printf("35569\n");return 0;}
else if(x>35537){printf("35543\n");return 0;}
else if(x>35533){printf("35537\n");return 0;}
else if(x>35531){printf("35533\n");return 0;}
else if(x>35527){printf("35531\n");return 0;}
else if(x>35521){printf("35527\n");return 0;}
else if(x>35509){printf("35521\n");return 0;}
else if(x>35507){printf("35509\n");return 0;}
else if(x>35491){printf("35507\n");return 0;}
else if(x>35461){printf("35491\n");return 0;}
else if(x>35449){printf("35461\n");return 0;}
else if(x>35447){printf("35449\n");return 0;}
else if(x>35437){printf("35447\n");return 0;}
else if(x>35423){printf("35437\n");return 0;}
else if(x>35419){printf("35423\n");return 0;}
else if(x>35407){printf("35419\n");return 0;}
else if(x>35401){printf("35407\n");return 0;}
else if(x>35393){printf("35401\n");return 0;}
else if(x>35381){printf("35393\n");return 0;}
else if(x>35363){printf("35381\n");return 0;}
else if(x>35353){printf("35363\n");return 0;}
else if(x>35339){printf("35353\n");return 0;}
else if(x>35327){printf("35339\n");return 0;}
else if(x>35323){printf("35327\n");return 0;}
else if(x>35317){printf("35323\n");return 0;}
else if(x>35311){printf("35317\n");return 0;}
else if(x>35291){printf("35311\n");return 0;}
else if(x>35281){printf("35291\n");return 0;}
else if(x>35279){printf("35281\n");return 0;}
else if(x>35267){printf("35279\n");return 0;}
else if(x>35257){printf("35267\n");return 0;}
else if(x>35251){printf("35257\n");return 0;}
else if(x>35227){printf("35251\n");return 0;}
else if(x>35221){printf("35227\n");return 0;}
else if(x>35201){printf("35221\n");return 0;}
else if(x>35171){printf("35201\n");return 0;}
else if(x>35159){printf("35171\n");return 0;}
else if(x>35153){printf("35159\n");return 0;}
else if(x>35149){printf("35153\n");return 0;}
else if(x>35141){printf("35149\n");return 0;}
else if(x>35129){printf("35141\n");return 0;}
else if(x>35117){printf("35129\n");return 0;}
else if(x>35111){printf("35117\n");return 0;}
else if(x>35107){printf("35111\n");return 0;}
else if(x>35099){printf("35107\n");return 0;}
else if(x>35089){printf("35099\n");return 0;}
else if(x>35083){printf("35089\n");return 0;}
else if(x>35081){printf("35083\n");return 0;}
else if(x>35069){printf("35081\n");return 0;}
else if(x>35059){printf("35069\n");return 0;}
else if(x>35053){printf("35059\n");return 0;}
else if(x>35051){printf("35053\n");return 0;}
else if(x>35027){printf("35051\n");return 0;}
else if(x>35023){printf("35027\n");return 0;}
else if(x>34981){printf("35023\n");return 0;}
else if(x>34963){printf("34981\n");return 0;}
else if(x>34961){printf("34963\n");return 0;}
else if(x>34949){printf("34961\n");return 0;}
else if(x>34939){printf("34949\n");return 0;}
else if(x>34919){printf("34939\n");return 0;}
else if(x>34913){printf("34919\n");return 0;}
else if(x>34897){printf("34913\n");return 0;}
else if(x>34883){printf("34897\n");return 0;}
else if(x>34877){printf("34883\n");return 0;}
else if(x>34871){printf("34877\n");return 0;}
else if(x>34849){printf("34871\n");return 0;}
else if(x>34847){printf("34849\n");return 0;}
else if(x>34843){printf("34847\n");return 0;}
else if(x>34841){printf("34843\n");return 0;}
else if(x>34819){printf("34841\n");return 0;}
else if(x>34807){printf("34819\n");return 0;}
else if(x>34781){printf("34807\n");return 0;}
else if(x>34763){printf("34781\n");return 0;}
else if(x>34759){printf("34763\n");return 0;}
else if(x>34757){printf("34759\n");return 0;}
else if(x>34747){printf("34757\n");return 0;}
else if(x>34739){printf("34747\n");return 0;}
else if(x>34729){printf("34739\n");return 0;}
else if(x>34721){printf("34729\n");return 0;}
else if(x>34703){printf("34721\n");return 0;}
else if(x>34693){printf("34703\n");return 0;}
else if(x>34687){printf("34693\n");return 0;}
else if(x>34679){printf("34687\n");return 0;}
else if(x>34673){printf("34679\n");return 0;}
else if(x>34667){printf("34673\n");return 0;}
else if(x>34651){printf("34667\n");return 0;}
else if(x>34649){printf("34651\n");return 0;}
else if(x>34631){printf("34649\n");return 0;}
else if(x>34613){printf("34631\n");return 0;}
else if(x>34607){printf("34613\n");return 0;}
else if(x>34603){printf("34607\n");return 0;}
else if(x>34591){printf("34603\n");return 0;}
else if(x>34589){printf("34591\n");return 0;}
else if(x>34583){printf("34589\n");return 0;}
else if(x>34549){printf("34583\n");return 0;}
else if(x>34543){printf("34549\n");return 0;}
else if(x>34537){printf("34543\n");return 0;}
else if(x>34519){printf("34537\n");return 0;}
else if(x>34513){printf("34519\n");return 0;}
else if(x>34511){printf("34513\n");return 0;}
else if(x>34501){printf("34511\n");return 0;}
else if(x>34499){printf("34501\n");return 0;}
else if(x>34487){printf("34499\n");return 0;}
else if(x>34483){printf("34487\n");return 0;}
else if(x>34471){printf("34483\n");return 0;}
else if(x>34469){printf("34471\n");return 0;}
else if(x>34457){printf("34469\n");return 0;}
else if(x>34439){printf("34457\n");return 0;}
else if(x>34429){printf("34439\n");return 0;}
else if(x>34421){printf("34429\n");return 0;}
else if(x>34403){printf("34421\n");return 0;}
else if(x>34381){printf("34403\n");return 0;}
else if(x>34369){printf("34381\n");return 0;}
else if(x>34367){printf("34369\n");return 0;}
else if(x>34361){printf("34367\n");return 0;}
else if(x>34351){printf("34361\n");return 0;}
else if(x>34337){printf("34351\n");return 0;}
else if(x>34327){printf("34337\n");return 0;}
else if(x>34319){printf("34327\n");return 0;}
else if(x>34313){printf("34319\n");return 0;}
else if(x>34303){printf("34313\n");return 0;}
else if(x>34301){printf("34303\n");return 0;}
else if(x>34297){printf("34301\n");return 0;}
else if(x>34283){printf("34297\n");return 0;}
else if(x>34273){printf("34283\n");return 0;}
else if(x>34267){printf("34273\n");return 0;}
else if(x>34261){printf("34267\n");return 0;}
else if(x>34259){printf("34261\n");return 0;}
else if(x>34253){printf("34259\n");return 0;}
else if(x>34231){printf("34253\n");return 0;}
else if(x>34217){printf("34231\n");return 0;}
else if(x>34213){printf("34217\n");return 0;}
else if(x>34211){printf("34213\n");return 0;}
else if(x>34183){printf("34211\n");return 0;}
else if(x>34171){printf("34183\n");return 0;}
else if(x>34159){printf("34171\n");return 0;}
else if(x>34157){printf("34159\n");return 0;}
else if(x>34147){printf("34157\n");return 0;}
else if(x>34141){printf("34147\n");return 0;}
else if(x>34129){printf("34141\n");return 0;}
else if(x>34127){printf("34129\n");return 0;}
else if(x>34123){printf("34127\n");return 0;}
else if(x>34061){printf("34123\n");return 0;}
else if(x>34057){printf("34061\n");return 0;}
else if(x>34039){printf("34057\n");return 0;}
else if(x>34033){printf("34039\n");return 0;}
else if(x>34031){printf("34033\n");return 0;}
else if(x>34019){printf("34031\n");return 0;}
else if(x>33997){printf("34019\n");return 0;}
else if(x>33967){printf("33997\n");return 0;}
else if(x>33961){printf("33967\n");return 0;}
else if(x>33941){printf("33961\n");return 0;}
else if(x>33937){printf("33941\n");return 0;}
else if(x>33931){printf("33937\n");return 0;}
else if(x>33923){printf("33931\n");return 0;}
else if(x>33911){printf("33923\n");return 0;}
else if(x>33893){printf("33911\n");return 0;}
else if(x>33889){printf("33893\n");return 0;}
else if(x>33871){printf("33889\n");return 0;}
else if(x>33863){printf("33871\n");return 0;}
else if(x>33857){printf("33863\n");return 0;}
else if(x>33851){printf("33857\n");return 0;}
else if(x>33829){printf("33851\n");return 0;}
else if(x>33827){printf("33829\n");return 0;}
else if(x>33811){printf("33827\n");return 0;}
else if(x>33809){printf("33811\n");return 0;}
else if(x>33797){printf("33809\n");return 0;}
else if(x>33791){printf("33797\n");return 0;}
else if(x>33773){printf("33791\n");return 0;}
else if(x>33769){printf("33773\n");return 0;}
else if(x>33767){printf("33769\n");return 0;}
else if(x>33757){printf("33767\n");return 0;}
else if(x>33751){printf("33757\n");return 0;}
else if(x>33749){printf("33751\n");return 0;}
else if(x>33739){printf("33749\n");return 0;}
else if(x>33721){printf("33739\n");return 0;}
else if(x>33713){printf("33721\n");return 0;}
else if(x>33703){printf("33713\n");return 0;}
else if(x>33679){printf("33703\n");return 0;}
else if(x>33647){printf("33679\n");return 0;}
else if(x>33641){printf("33647\n");return 0;}
else if(x>33637){printf("33641\n");return 0;}
else if(x>33629){printf("33637\n");return 0;}
else if(x>33623){printf("33629\n");return 0;}
else if(x>33619){printf("33623\n");return 0;}
else if(x>33617){printf("33619\n");return 0;}
else if(x>33613){printf("33617\n");return 0;}
else if(x>33601){printf("33613\n");return 0;}
else if(x>33599){printf("33601\n");return 0;}
else if(x>33589){printf("33599\n");return 0;}
else if(x>33587){printf("33589\n");return 0;}
else if(x>33581){printf("33587\n");return 0;}
else if(x>33577){printf("33581\n");return 0;}
else if(x>33569){printf("33577\n");return 0;}
else if(x>33563){printf("33569\n");return 0;}
else if(x>33547){printf("33563\n");return 0;}
else if(x>33533){printf("33547\n");return 0;}
else if(x>33529){printf("33533\n");return 0;}
else if(x>33521){printf("33529\n");return 0;}
else if(x>33503){printf("33521\n");return 0;}
else if(x>33493){printf("33503\n");return 0;}
else if(x>33487){printf("33493\n");return 0;}
else if(x>33479){printf("33487\n");return 0;}
else if(x>33469){printf("33479\n");return 0;}
else if(x>33461){printf("33469\n");return 0;}
else if(x>33457){printf("33461\n");return 0;}
else if(x>33427){printf("33457\n");return 0;}
else if(x>33413){printf("33427\n");return 0;}
else if(x>33409){printf("33413\n");return 0;}
else if(x>33403){printf("33409\n");return 0;}
else if(x>33391){printf("33403\n");return 0;}
else if(x>33377){printf("33391\n");return 0;}
else if(x>33359){printf("33377\n");return 0;}
else if(x>33353){printf("33359\n");return 0;}
else if(x>33349){printf("33353\n");return 0;}
else if(x>33347){printf("33349\n");return 0;}
else if(x>33343){printf("33347\n");return 0;}
else if(x>33331){printf("33343\n");return 0;}
else if(x>33329){printf("33331\n");return 0;}
else if(x>33317){printf("33329\n");return 0;}
else if(x>33311){printf("33317\n");return 0;}
else if(x>33301){printf("33311\n");return 0;}
else if(x>33289){printf("33301\n");return 0;}
else if(x>33287){printf("33289\n");return 0;}
else if(x>33247){printf("33287\n");return 0;}
else if(x>33223){printf("33247\n");return 0;}
else if(x>33211){printf("33223\n");return 0;}
else if(x>33203){printf("33211\n");return 0;}
else if(x>33199){printf("33203\n");return 0;}
else if(x>33191){printf("33199\n");return 0;}
else if(x>33181){printf("33191\n");return 0;}
else if(x>33179){printf("33181\n");return 0;}
else if(x>33161){printf("33179\n");return 0;}
else if(x>33151){printf("33161\n");return 0;}
else if(x>33149){printf("33151\n");return 0;}
else if(x>33119){printf("33149\n");return 0;}
else if(x>33113){printf("33119\n");return 0;}
else if(x>33107){printf("33113\n");return 0;}
else if(x>33091){printf("33107\n");return 0;}
else if(x>33083){printf("33091\n");return 0;}
else if(x>33073){printf("33083\n");return 0;}
else if(x>33071){printf("33073\n");return 0;}
else if(x>33053){printf("33071\n");return 0;}
else if(x>33049){printf("33053\n");return 0;}
else if(x>33037){printf("33049\n");return 0;}
else if(x>33029){printf("33037\n");return 0;}
else if(x>33023){printf("33029\n");return 0;}
else if(x>33013){printf("33023\n");return 0;}
else if(x>32999){printf("33013\n");return 0;}
else if(x>32993){printf("32999\n");return 0;}
else if(x>32987){printf("32993\n");return 0;}
else if(x>32983){printf("32987\n");return 0;}
else if(x>32971){printf("32983\n");return 0;}
else if(x>32969){printf("32971\n");return 0;}
else if(x>32957){printf("32969\n");return 0;}
else if(x>32941){printf("32957\n");return 0;}
else if(x>32939){printf("32941\n");return 0;}
else if(x>32933){printf("32939\n");return 0;}
else if(x>32917){printf("32933\n");return 0;}
else if(x>32911){printf("32917\n");return 0;}
else if(x>32909){printf("32911\n");return 0;}
else if(x>32887){printf("32909\n");return 0;}
else if(x>32869){printf("32887\n");return 0;}
else if(x>32843){printf("32869\n");return 0;}
else if(x>32839){printf("32843\n");return 0;}
else if(x>32833){printf("32839\n");return 0;}
else if(x>32831){printf("32833\n");return 0;}
else if(x>32803){printf("32831\n");return 0;}
else if(x>32801){printf("32803\n");return 0;}
else if(x>32797){printf("32801\n");return 0;}
else if(x>32789){printf("32797\n");return 0;}
else if(x>32783){printf("32789\n");return 0;}
else if(x>32779){printf("32783\n");return 0;}
else if(x>32771){printf("32779\n");return 0;}
else if(x>32749){printf("32771\n");return 0;}
else if(x>32719){printf("32749\n");return 0;}
else if(x>32717){printf("32719\n");return 0;}
else if(x>32713){printf("32717\n");return 0;}
else if(x>32707){printf("32713\n");return 0;}
else if(x>32693){printf("32707\n");return 0;}
else if(x>32687){printf("32693\n");return 0;}
else if(x>32653){printf("32687\n");return 0;}
else if(x>32647){printf("32653\n");return 0;}
else if(x>32633){printf("32647\n");return 0;}
else if(x>32621){printf("32633\n");return 0;}
else if(x>32611){printf("32621\n");return 0;}
else if(x>32609){printf("32611\n");return 0;}
else if(x>32603){printf("32609\n");return 0;}
else if(x>32587){printf("32603\n");return 0;}
else if(x>32579){printf("32587\n");return 0;}
else if(x>32573){printf("32579\n");return 0;}
else if(x>32569){printf("32573\n");return 0;}
else if(x>32563){printf("32569\n");return 0;}
else if(x>32561){printf("32563\n");return 0;}
else if(x>32537){printf("32561\n");return 0;}
else if(x>32533){printf("32537\n");return 0;}
else if(x>32531){printf("32533\n");return 0;}
else if(x>32507){printf("32531\n");return 0;}
else if(x>32503){printf("32507\n");return 0;}
else if(x>32497){printf("32503\n");return 0;}
else if(x>32491){printf("32497\n");return 0;}
else if(x>32479){printf("32491\n");return 0;}
else if(x>32467){printf("32479\n");return 0;}
else if(x>32443){printf("32467\n");return 0;}
else if(x>32441){printf("32443\n");return 0;}
else if(x>32429){printf("32441\n");return 0;}
else if(x>32423){printf("32429\n");return 0;}
else if(x>32413){printf("32423\n");return 0;}
else if(x>32411){printf("32413\n");return 0;}
else if(x>32401){printf("32411\n");return 0;}
else if(x>32381){printf("32401\n");return 0;}
else if(x>32377){printf("32381\n");return 0;}
else if(x>32371){printf("32377\n");return 0;}
else if(x>32369){printf("32371\n");return 0;}
else if(x>32363){printf("32369\n");return 0;}
else if(x>32359){printf("32363\n");return 0;}
else if(x>32353){printf("32359\n");return 0;}
else if(x>32341){printf("32353\n");return 0;}
else if(x>32327){printf("32341\n");return 0;}
else if(x>32323){printf("32327\n");return 0;}
else if(x>32321){printf("32323\n");return 0;}
else if(x>32309){printf("32321\n");return 0;}
else if(x>32303){printf("32309\n");return 0;}
else if(x>32299){printf("32303\n");return 0;}
else if(x>32297){printf("32299\n");return 0;}
else if(x>32261){printf("32297\n");return 0;}
else if(x>32257){printf("32261\n");return 0;}
else if(x>32251){printf("32257\n");return 0;}
else if(x>32237){printf("32251\n");return 0;}
else if(x>32233){printf("32237\n");return 0;}
else if(x>32213){printf("32233\n");return 0;}
else if(x>32203){printf("32213\n");return 0;}
else if(x>32191){printf("32203\n");return 0;}
else if(x>32189){printf("32191\n");return 0;}
else if(x>32183){printf("32189\n");return 0;}
else if(x>32173){printf("32183\n");return 0;}
else if(x>32159){printf("32173\n");return 0;}
else if(x>32143){printf("32159\n");return 0;}
else if(x>32141){printf("32143\n");return 0;}
else if(x>32119){printf("32141\n");return 0;}
else if(x>32117){printf("32119\n");return 0;}
else if(x>32099){printf("32117\n");return 0;}
else if(x>32089){printf("32099\n");return 0;}
else if(x>32083){printf("32089\n");return 0;}
else if(x>32077){printf("32083\n");return 0;}
else if(x>32069){printf("32077\n");return 0;}
else if(x>32063){printf("32069\n");return 0;}
else if(x>32059){printf("32063\n");return 0;}
else if(x>32057){printf("32059\n");return 0;}
else if(x>32051){printf("32057\n");return 0;}
else if(x>32029){printf("32051\n");return 0;}
else if(x>32027){printf("32029\n");return 0;}
else if(x>32009){printf("32027\n");return 0;}
else if(x>32003){printf("32009\n");return 0;}
else if(x>31991){printf("32003\n");return 0;}
else if(x>31981){printf("31991\n");return 0;}
else if(x>31973){printf("31981\n");return 0;}
else if(x>31963){printf("31973\n");return 0;}
else if(x>31957){printf("31963\n");return 0;}
else if(x>31907){printf("31957\n");return 0;}
else if(x>31891){printf("31907\n");return 0;}
else if(x>31883){printf("31891\n");return 0;}
else if(x>31873){printf("31883\n");return 0;}
else if(x>31859){printf("31873\n");return 0;}
else if(x>31849){printf("31859\n");return 0;}
else if(x>31847){printf("31849\n");return 0;}
else if(x>31817){printf("31847\n");return 0;}
else if(x>31799){printf("31817\n");return 0;}
else if(x>31793){printf("31799\n");return 0;}
else if(x>31771){printf("31793\n");return 0;}
else if(x>31769){printf("31771\n");return 0;}
else if(x>31751){printf("31769\n");return 0;}
else if(x>31741){printf("31751\n");return 0;}
else if(x>31729){printf("31741\n");return 0;}
else if(x>31727){printf("31729\n");return 0;}
else if(x>31723){printf("31727\n");return 0;}
else if(x>31721){printf("31723\n");return 0;}
else if(x>31699){printf("31721\n");return 0;}
else if(x>31687){printf("31699\n");return 0;}
else if(x>31667){printf("31687\n");return 0;}
else if(x>31663){printf("31667\n");return 0;}
else if(x>31657){printf("31663\n");return 0;}
else if(x>31649){printf("31657\n");return 0;}
else if(x>31643){printf("31649\n");return 0;}
else if(x>31627){printf("31643\n");return 0;}
else if(x>31607){printf("31627\n");return 0;}
else if(x>31601){printf("31607\n");return 0;}
else if(x>31583){printf("31601\n");return 0;}
else if(x>31573){printf("31583\n");return 0;}
else if(x>31567){printf("31573\n");return 0;}
else if(x>31547){printf("31567\n");return 0;}
else if(x>31543){printf("31547\n");return 0;}
else if(x>31541){printf("31543\n");return 0;}
else if(x>31531){printf("31541\n");return 0;}
else if(x>31517){printf("31531\n");return 0;}
else if(x>31513){printf("31517\n");return 0;}
else if(x>31511){printf("31513\n");return 0;}
else if(x>31489){printf("31511\n");return 0;}
else if(x>31481){printf("31489\n");return 0;}
else if(x>31477){printf("31481\n");return 0;}
else if(x>31469){printf("31477\n");return 0;}
else if(x>31397){printf("31469\n");return 0;}
else if(x>31393){printf("31397\n");return 0;}
else if(x>31391){printf("31393\n");return 0;}
else if(x>31387){printf("31391\n");return 0;}
else if(x>31379){printf("31387\n");return 0;}
else if(x>31357){printf("31379\n");return 0;}
else if(x>31337){printf("31357\n");return 0;}
else if(x>31333){printf("31337\n");return 0;}
else if(x>31327){printf("31333\n");return 0;}
else if(x>31321){printf("31327\n");return 0;}
else if(x>31319){printf("31321\n");return 0;}
else if(x>31307){printf("31319\n");return 0;}
else if(x>31277){printf("31307\n");return 0;}
else if(x>31271){printf("31277\n");return 0;}
else if(x>31267){printf("31271\n");return 0;}
else if(x>31259){printf("31267\n");return 0;}
else if(x>31253){printf("31259\n");return 0;}
else if(x>31249){printf("31253\n");return 0;}
else if(x>31247){printf("31249\n");return 0;}
else if(x>31237){printf("31247\n");return 0;}
else if(x>31231){printf("31237\n");return 0;}
else if(x>31223){printf("31231\n");return 0;}
else if(x>31219){printf("31223\n");return 0;}
else if(x>31193){printf("31219\n");return 0;}
else if(x>31189){printf("31193\n");return 0;}
else if(x>31183){printf("31189\n");return 0;}
else if(x>31181){printf("31183\n");return 0;}
else if(x>31177){printf("31181\n");return 0;}
else if(x>31159){printf("31177\n");return 0;}
else if(x>31153){printf("31159\n");return 0;}
else if(x>31151){printf("31153\n");return 0;}
else if(x>31147){printf("31151\n");return 0;}
else if(x>31139){printf("31147\n");return 0;}
else if(x>31123){printf("31139\n");return 0;}
else if(x>31121){printf("31123\n");return 0;}
else if(x>31091){printf("31121\n");return 0;}
else if(x>31081){printf("31091\n");return 0;}
else if(x>31079){printf("31081\n");return 0;}
else if(x>31069){printf("31079\n");return 0;}
else if(x>31063){printf("31069\n");return 0;}
else if(x>31051){printf("31063\n");return 0;}
else if(x>31039){printf("31051\n");return 0;}
else if(x>31033){printf("31039\n");return 0;}
else if(x>31019){printf("31033\n");return 0;}
else if(x>31013){printf("31019\n");return 0;}
else if(x>30983){printf("31013\n");return 0;}
else if(x>30977){printf("30983\n");return 0;}
else if(x>30971){printf("30977\n");return 0;}
else if(x>30949){printf("30971\n");return 0;}
else if(x>30941){printf("30949\n");return 0;}
else if(x>30937){printf("30941\n");return 0;}
else if(x>30931){printf("30937\n");return 0;}
else if(x>30911){printf("30931\n");return 0;}
else if(x>30893){printf("30911\n");return 0;}
else if(x>30881){printf("30893\n");return 0;}
else if(x>30871){printf("30881\n");return 0;}
else if(x>30869){printf("30871\n");return 0;}
else if(x>30859){printf("30869\n");return 0;}
else if(x>30853){printf("30859\n");return 0;}
else if(x>30851){printf("30853\n");return 0;}
else if(x>30841){printf("30851\n");return 0;}
else if(x>30839){printf("30841\n");return 0;}
else if(x>30829){printf("30839\n");return 0;}
else if(x>30817){printf("30829\n");return 0;}
else if(x>30809){printf("30817\n");return 0;}
else if(x>30803){printf("30809\n");return 0;}
else if(x>30781){printf("30803\n");return 0;}
else if(x>30773){printf("30781\n");return 0;}
else if(x>30763){printf("30773\n");return 0;}
else if(x>30757){printf("30763\n");return 0;}
else if(x>30727){printf("30757\n");return 0;}
else if(x>30713){printf("30727\n");return 0;}
else if(x>30707){printf("30713\n");return 0;}
else if(x>30703){printf("30707\n");return 0;}
else if(x>30697){printf("30703\n");return 0;}
else if(x>30689){printf("30697\n");return 0;}
else if(x>30677){printf("30689\n");return 0;}
else if(x>30671){printf("30677\n");return 0;}
else if(x>30661){printf("30671\n");return 0;}
else if(x>30649){printf("30661\n");return 0;}
else if(x>30643){printf("30649\n");return 0;}
else if(x>30637){printf("30643\n");return 0;}
else if(x>30631){printf("30637\n");return 0;}
else if(x>30593){printf("30631\n");return 0;}
else if(x>30577){printf("30593\n");return 0;}
else if(x>30559){printf("30577\n");return 0;}
else if(x>30557){printf("30559\n");return 0;}
else if(x>30553){printf("30557\n");return 0;}
else if(x>30539){printf("30553\n");return 0;}
else if(x>30529){printf("30539\n");return 0;}
else if(x>30517){printf("30529\n");return 0;}
else if(x>30509){printf("30517\n");return 0;}
else if(x>30497){printf("30509\n");return 0;}
else if(x>30493){printf("30497\n");return 0;}
else if(x>30491){printf("30493\n");return 0;}
else if(x>30469){printf("30491\n");return 0;}
else if(x>30467){printf("30469\n");return 0;}
else if(x>30449){printf("30467\n");return 0;}
else if(x>30431){printf("30449\n");return 0;}
else if(x>30427){printf("30431\n");return 0;}
else if(x>30403){printf("30427\n");return 0;}
else if(x>30391){printf("30403\n");return 0;}
else if(x>30389){printf("30391\n");return 0;}
else if(x>30367){printf("30389\n");return 0;}
else if(x>30347){printf("30367\n");return 0;}
else if(x>30341){printf("30347\n");return 0;}
else if(x>30323){printf("30341\n");return 0;}
else if(x>30319){printf("30323\n");return 0;}
else if(x>30313){printf("30319\n");return 0;}
else if(x>30307){printf("30313\n");return 0;}
else if(x>30293){printf("30307\n");return 0;}
else if(x>30271){printf("30293\n");return 0;}
else if(x>30269){printf("30271\n");return 0;}
else if(x>30259){printf("30269\n");return 0;}
else if(x>30253){printf("30259\n");return 0;}
else if(x>30241){printf("30253\n");return 0;}
else if(x>30223){printf("30241\n");return 0;}
else if(x>30211){printf("30223\n");return 0;}
else if(x>30203){printf("30211\n");return 0;}
else if(x>30197){printf("30203\n");return 0;}
else if(x>30187){printf("30197\n");return 0;}
else if(x>30181){printf("30187\n");return 0;}
else if(x>30169){printf("30181\n");return 0;}
else if(x>30161){printf("30169\n");return 0;}
else if(x>30139){printf("30161\n");return 0;}
else if(x>30137){printf("30139\n");return 0;}
else if(x>30133){printf("30137\n");return 0;}
else if(x>30119){printf("30133\n");return 0;}
else if(x>30113){printf("30119\n");return 0;}
else if(x>30109){printf("30113\n");return 0;}
else if(x>30103){printf("30109\n");return 0;}
else if(x>30097){printf("30103\n");return 0;}
else if(x>30091){printf("30097\n");return 0;}
else if(x>30089){printf("30091\n");return 0;}
else if(x>30071){printf("30089\n");return 0;}
else if(x>30059){printf("30071\n");return 0;}
else if(x>30047){printf("30059\n");return 0;}
else if(x>30029){printf("30047\n");return 0;}
else if(x>30013){printf("30029\n");return 0;}
else if(x>30011){printf("30013\n");return 0;}
else if(x>29989){printf("30011\n");return 0;}
else if(x>29983){printf("29989\n");return 0;}
else if(x>29959){printf("29983\n");return 0;}
else if(x>29947){printf("29959\n");return 0;}
else if(x>29927){printf("29947\n");return 0;}
else if(x>29921){printf("29927\n");return 0;}
else if(x>29917){printf("29921\n");return 0;}
else if(x>29881){printf("29917\n");return 0;}
else if(x>29879){printf("29881\n");return 0;}
else if(x>29873){printf("29879\n");return 0;}
else if(x>29867){printf("29873\n");return 0;}
else if(x>29863){printf("29867\n");return 0;}
else if(x>29851){printf("29863\n");return 0;}
else if(x>29837){printf("29851\n");return 0;}
else if(x>29833){printf("29837\n");return 0;}
else if(x>29819){printf("29833\n");return 0;}
else if(x>29803){printf("29819\n");return 0;}
else if(x>29789){printf("29803\n");return 0;}
else if(x>29761){printf("29789\n");return 0;}
else if(x>29759){printf("29761\n");return 0;}
else if(x>29753){printf("29759\n");return 0;}
else if(x>29741){printf("29753\n");return 0;}
else if(x>29723){printf("29741\n");return 0;}
else if(x>29717){printf("29723\n");return 0;}
else if(x>29683){printf("29717\n");return 0;}
else if(x>29671){printf("29683\n");return 0;}
else if(x>29669){printf("29671\n");return 0;}
else if(x>29663){printf("29669\n");return 0;}
else if(x>29641){printf("29663\n");return 0;}
else if(x>29633){printf("29641\n");return 0;}
else if(x>29629){printf("29633\n");return 0;}
else if(x>29611){printf("29629\n");return 0;}
else if(x>29599){printf("29611\n");return 0;}
else if(x>29587){printf("29599\n");return 0;}
else if(x>29581){printf("29587\n");return 0;}
else if(x>29573){printf("29581\n");return 0;}
else if(x>29569){printf("29573\n");return 0;}
else if(x>29567){printf("29569\n");return 0;}
else if(x>29537){printf("29567\n");return 0;}
else if(x>29531){printf("29537\n");return 0;}
else if(x>29527){printf("29531\n");return 0;}
else if(x>29501){printf("29527\n");return 0;}
else if(x>29483){printf("29501\n");return 0;}
else if(x>29473){printf("29483\n");return 0;}
else if(x>29453){printf("29473\n");return 0;}
else if(x>29443){printf("29453\n");return 0;}
else if(x>29437){printf("29443\n");return 0;}
else if(x>29429){printf("29437\n");return 0;}
else if(x>29423){printf("29429\n");return 0;}
else if(x>29411){printf("29423\n");return 0;}
else if(x>29401){printf("29411\n");return 0;}
else if(x>29399){printf("29401\n");return 0;}
else if(x>29389){printf("29399\n");return 0;}
else if(x>29387){printf("29389\n");return 0;}
else if(x>29383){printf("29387\n");return 0;}
else if(x>29363){printf("29383\n");return 0;}
else if(x>29347){printf("29363\n");return 0;}
else if(x>29339){printf("29347\n");return 0;}
else if(x>29333){printf("29339\n");return 0;}
else if(x>29327){printf("29333\n");return 0;}
else if(x>29311){printf("29327\n");return 0;}
else if(x>29303){printf("29311\n");return 0;}
else if(x>29297){printf("29303\n");return 0;}
else if(x>29287){printf("29297\n");return 0;}
else if(x>29269){printf("29287\n");return 0;}
else if(x>29251){printf("29269\n");return 0;}
else if(x>29243){printf("29251\n");return 0;}
else if(x>29231){printf("29243\n");return 0;}
else if(x>29221){printf("29231\n");return 0;}
else if(x>29209){printf("29221\n");return 0;}
else if(x>29207){printf("29209\n");return 0;}
else if(x>29201){printf("29207\n");return 0;}
else if(x>29191){printf("29201\n");return 0;}
else if(x>29179){printf("29191\n");return 0;}
else if(x>29173){printf("29179\n");return 0;}
else if(x>29167){printf("29173\n");return 0;}
else if(x>29153){printf("29167\n");return 0;}
else if(x>29147){printf("29153\n");return 0;}
else if(x>29137){printf("29147\n");return 0;}
else if(x>29131){printf("29137\n");return 0;}
else if(x>29129){printf("29131\n");return 0;}
else if(x>29123){printf("29129\n");return 0;}
else if(x>29101){printf("29123\n");return 0;}
else if(x>29077){printf("29101\n");return 0;}
else if(x>29063){printf("29077\n");return 0;}
else if(x>29059){printf("29063\n");return 0;}
else if(x>29033){printf("29059\n");return 0;}
else if(x>29027){printf("29033\n");return 0;}
else if(x>29023){printf("29027\n");return 0;}
else if(x>29021){printf("29023\n");return 0;}
else if(x>29017){printf("29021\n");return 0;}
else if(x>29009){printf("29017\n");return 0;}
else if(x>28979){printf("29009\n");return 0;}
else if(x>28961){printf("28979\n");return 0;}
else if(x>28949){printf("28961\n");return 0;}
else if(x>28933){printf("28949\n");return 0;}
else if(x>28927){printf("28933\n");return 0;}
else if(x>28921){printf("28927\n");return 0;}
else if(x>28909){printf("28921\n");return 0;}
else if(x>28901){printf("28909\n");return 0;}
else if(x>28879){printf("28901\n");return 0;}
else if(x>28871){printf("28879\n");return 0;}
else if(x>28867){printf("28871\n");return 0;}
else if(x>28859){printf("28867\n");return 0;}
else if(x>28843){printf("28859\n");return 0;}
else if(x>28837){printf("28843\n");return 0;}
else if(x>28817){printf("28837\n");return 0;}
else if(x>28813){printf("28817\n");return 0;}
else if(x>28807){printf("28813\n");return 0;}
else if(x>28793){printf("28807\n");return 0;}
else if(x>28789){printf("28793\n");return 0;}
else if(x>28771){printf("28789\n");return 0;}
else if(x>28759){printf("28771\n");return 0;}
else if(x>28753){printf("28759\n");return 0;}
else if(x>28751){printf("28753\n");return 0;}
else if(x>28729){printf("28751\n");return 0;}
else if(x>28723){printf("28729\n");return 0;}
else if(x>28711){printf("28723\n");return 0;}
else if(x>28703){printf("28711\n");return 0;}
else if(x>28697){printf("28703\n");return 0;}
else if(x>28687){printf("28697\n");return 0;}
else if(x>28669){printf("28687\n");return 0;}
else if(x>28663){printf("28669\n");return 0;}
else if(x>28661){printf("28663\n");return 0;}
else if(x>28657){printf("28661\n");return 0;}
else if(x>28649){printf("28657\n");return 0;}
else if(x>28643){printf("28649\n");return 0;}
else if(x>28631){printf("28643\n");return 0;}
else if(x>28627){printf("28631\n");return 0;}
else if(x>28621){printf("28627\n");return 0;}
else if(x>28619){printf("28621\n");return 0;}
else if(x>28607){printf("28619\n");return 0;}
else if(x>28603){printf("28607\n");return 0;}
else if(x>28597){printf("28603\n");return 0;}
else if(x>28591){printf("28597\n");return 0;}
else if(x>28579){printf("28591\n");return 0;}
else if(x>28573){printf("28579\n");return 0;}
else if(x>28571){printf("28573\n");return 0;}
else if(x>28559){printf("28571\n");return 0;}
else if(x>28549){printf("28559\n");return 0;}
else if(x>28547){printf("28549\n");return 0;}
else if(x>28541){printf("28547\n");return 0;}
else if(x>28537){printf("28541\n");return 0;}
else if(x>28517){printf("28537\n");return 0;}
else if(x>28513){printf("28517\n");return 0;}
else if(x>28499){printf("28513\n");return 0;}
else if(x>28493){printf("28499\n");return 0;}
else if(x>28477){printf("28493\n");return 0;}
else if(x>28463){printf("28477\n");return 0;}
else if(x>28447){printf("28463\n");return 0;}
else if(x>28439){printf("28447\n");return 0;}
else if(x>28433){printf("28439\n");return 0;}
else if(x>28429){printf("28433\n");return 0;}
else if(x>28411){printf("28429\n");return 0;}
else if(x>28409){printf("28411\n");return 0;}
else if(x>28403){printf("28409\n");return 0;}
else if(x>28393){printf("28403\n");return 0;}
else if(x>28387){printf("28393\n");return 0;}
else if(x>28351){printf("28387\n");return 0;}
else if(x>28349){printf("28351\n");return 0;}
else if(x>28319){printf("28349\n");return 0;}
else if(x>28309){printf("28319\n");return 0;}
else if(x>28307){printf("28309\n");return 0;}
else if(x>28297){printf("28307\n");return 0;}
else if(x>28289){printf("28297\n");return 0;}
else if(x>28283){printf("28289\n");return 0;}
else if(x>28279){printf("28283\n");return 0;}
else if(x>28277){printf("28279\n");return 0;}
else if(x>28229){printf("28277\n");return 0;}
else if(x>28219){printf("28229\n");return 0;}
else if(x>28211){printf("28219\n");return 0;}
else if(x>28201){printf("28211\n");return 0;}
else if(x>28183){printf("28201\n");return 0;}
else if(x>28181){printf("28183\n");return 0;}
else if(x>28163){printf("28181\n");return 0;}
else if(x>28151){printf("28163\n");return 0;}
else if(x>28123){printf("28151\n");return 0;}
else if(x>28111){printf("28123\n");return 0;}
else if(x>28109){printf("28111\n");return 0;}
else if(x>28099){printf("28109\n");return 0;}
else if(x>28097){printf("28099\n");return 0;}
else if(x>28087){printf("28097\n");return 0;}
else if(x>28081){printf("28087\n");return 0;}
else if(x>28069){printf("28081\n");return 0;}
else if(x>28057){printf("28069\n");return 0;}
else if(x>28051){printf("28057\n");return 0;}
else if(x>28031){printf("28051\n");return 0;}
else if(x>28027){printf("28031\n");return 0;}
else if(x>28019){printf("28027\n");return 0;}
else if(x>28001){printf("28019\n");return 0;}
else if(x>27997){printf("28001\n");return 0;}
else if(x>27983){printf("27997\n");return 0;}
else if(x>27967){printf("27983\n");return 0;}
else if(x>27961){printf("27967\n");return 0;}
else if(x>27953){printf("27961\n");return 0;}
else if(x>27947){printf("27953\n");return 0;}
else if(x>27943){printf("27947\n");return 0;}
else if(x>27941){printf("27943\n");return 0;}
else if(x>27919){printf("27941\n");return 0;}
else if(x>27917){printf("27919\n");return 0;}
else if(x>27901){printf("27917\n");return 0;}
else if(x>27893){printf("27901\n");return 0;}
else if(x>27883){printf("27893\n");return 0;}
else if(x>27851){printf("27883\n");return 0;}
else if(x>27847){printf("27851\n");return 0;}
else if(x>27827){printf("27847\n");return 0;}
else if(x>27823){printf("27827\n");return 0;}
else if(x>27817){printf("27823\n");return 0;}
else if(x>27809){printf("27817\n");return 0;}
else if(x>27803){printf("27809\n");return 0;}
else if(x>27799){printf("27803\n");return 0;}
else if(x>27793){printf("27799\n");return 0;}
else if(x>27791){printf("27793\n");return 0;}
else if(x>27779){printf("27791\n");return 0;}
else if(x>27773){printf("27779\n");return 0;}
else if(x>27767){printf("27773\n");return 0;}
else if(x>27763){printf("27767\n");return 0;}
else if(x>27751){printf("27763\n");return 0;}
else if(x>27749){printf("27751\n");return 0;}
else if(x>27743){printf("27749\n");return 0;}
else if(x>27739){printf("27743\n");return 0;}
else if(x>27737){printf("27739\n");return 0;}
else if(x>27733){printf("27737\n");return 0;}
else if(x>27701){printf("27733\n");return 0;}
else if(x>27697){printf("27701\n");return 0;}
else if(x>27691){printf("27697\n");return 0;}
else if(x>27689){printf("27691\n");return 0;}
else if(x>27673){printf("27689\n");return 0;}
else if(x>27653){printf("27673\n");return 0;}
else if(x>27647){printf("27653\n");return 0;}
else if(x>27631){printf("27647\n");return 0;}
else if(x>27617){printf("27631\n");return 0;}
else if(x>27611){printf("27617\n");return 0;}
else if(x>27583){printf("27611\n");return 0;}
else if(x>27581){printf("27583\n");return 0;}
else if(x>27551){printf("27581\n");return 0;}
else if(x>27541){printf("27551\n");return 0;}
else if(x>27539){printf("27541\n");return 0;}
else if(x>27529){printf("27539\n");return 0;}
else if(x>27527){printf("27529\n");return 0;}
else if(x>27509){printf("27527\n");return 0;}
else if(x>27487){printf("27509\n");return 0;}
else if(x>27481){printf("27487\n");return 0;}
else if(x>27479){printf("27481\n");return 0;}
else if(x>27457){printf("27479\n");return 0;}
else if(x>27449){printf("27457\n");return 0;}
else if(x>27437){printf("27449\n");return 0;}
else if(x>27431){printf("27437\n");return 0;}
else if(x>27427){printf("27431\n");return 0;}
else if(x>27409){printf("27427\n");return 0;}
else if(x>27407){printf("27409\n");return 0;}
else if(x>27397){printf("27407\n");return 0;}
else if(x>27367){printf("27397\n");return 0;}
else if(x>27361){printf("27367\n");return 0;}
else if(x>27337){printf("27361\n");return 0;}
else if(x>27329){printf("27337\n");return 0;}
else if(x>27299){printf("27329\n");return 0;}
else if(x>27283){printf("27299\n");return 0;}
else if(x>27281){printf("27283\n");return 0;}
else if(x>27277){printf("27281\n");return 0;}
else if(x>27271){printf("27277\n");return 0;}
else if(x>27259){printf("27271\n");return 0;}
else if(x>27253){printf("27259\n");return 0;}
else if(x>27241){printf("27253\n");return 0;}
else if(x>27239){printf("27241\n");return 0;}
else if(x>27211){printf("27239\n");return 0;}
else if(x>27197){printf("27211\n");return 0;}
else if(x>27191){printf("27197\n");return 0;}
else if(x>27179){printf("27191\n");return 0;}
else if(x>27143){printf("27179\n");return 0;}
else if(x>27127){printf("27143\n");return 0;}
else if(x>27109){printf("27127\n");return 0;}
else if(x>27107){printf("27109\n");return 0;}
else if(x>27103){printf("27107\n");return 0;}
else if(x>27091){printf("27103\n");return 0;}
else if(x>27077){printf("27091\n");return 0;}
else if(x>27073){printf("27077\n");return 0;}
else if(x>27067){printf("27073\n");return 0;}
else if(x>27061){printf("27067\n");return 0;}
else if(x>27059){printf("27061\n");return 0;}
else if(x>27043){printf("27059\n");return 0;}
else if(x>27031){printf("27043\n");return 0;}
else if(x>27017){printf("27031\n");return 0;}
else if(x>27011){printf("27017\n");return 0;}
else if(x>26993){printf("27011\n");return 0;}
else if(x>26987){printf("26993\n");return 0;}
else if(x>26981){printf("26987\n");return 0;}
else if(x>26959){printf("26981\n");return 0;}
else if(x>26953){printf("26959\n");return 0;}
else if(x>26951){printf("26953\n");return 0;}
else if(x>26947){printf("26951\n");return 0;}
else if(x>26927){printf("26947\n");return 0;}
else if(x>26921){printf("26927\n");return 0;}
else if(x>26903){printf("26921\n");return 0;}
else if(x>26893){printf("26903\n");return 0;}
else if(x>26891){printf("26893\n");return 0;}
else if(x>26881){printf("26891\n");return 0;}
else if(x>26879){printf("26881\n");return 0;}
else if(x>26863){printf("26879\n");return 0;}
else if(x>26861){printf("26863\n");return 0;}
else if(x>26849){printf("26861\n");return 0;}
else if(x>26839){printf("26849\n");return 0;}
else if(x>26833){printf("26839\n");return 0;}
else if(x>26821){printf("26833\n");return 0;}
else if(x>26813){printf("26821\n");return 0;}
else if(x>26801){printf("26813\n");return 0;}
else if(x>26783){printf("26801\n");return 0;}
else if(x>26777){printf("26783\n");return 0;}
else if(x>26759){printf("26777\n");return 0;}
else if(x>26737){printf("26759\n");return 0;}
else if(x>26731){printf("26737\n");return 0;}
else if(x>26729){printf("26731\n");return 0;}
else if(x>26723){printf("26729\n");return 0;}
else if(x>26717){printf("26723\n");return 0;}
else if(x>26713){printf("26717\n");return 0;}
else if(x>26711){printf("26713\n");return 0;}
else if(x>26701){printf("26711\n");return 0;}
else if(x>26699){printf("26701\n");return 0;}
else if(x>26693){printf("26699\n");return 0;}
else if(x>26687){printf("26693\n");return 0;}
else if(x>26683){printf("26687\n");return 0;}
else if(x>26681){printf("26683\n");return 0;}
else if(x>26669){printf("26681\n");return 0;}
else if(x>26647){printf("26669\n");return 0;}
else if(x>26641){printf("26647\n");return 0;}
else if(x>26633){printf("26641\n");return 0;}
else if(x>26627){printf("26633\n");return 0;}
else if(x>26597){printf("26627\n");return 0;}
else if(x>26591){printf("26597\n");return 0;}
else if(x>26573){printf("26591\n");return 0;}
else if(x>26561){printf("26573\n");return 0;}
else if(x>26557){printf("26561\n");return 0;}
else if(x>26539){printf("26557\n");return 0;}
else if(x>26513){printf("26539\n");return 0;}
else if(x>26501){printf("26513\n");return 0;}
else if(x>26497){printf("26501\n");return 0;}
else if(x>26489){printf("26497\n");return 0;}
else if(x>26479){printf("26489\n");return 0;}
else if(x>26459){printf("26479\n");return 0;}
else if(x>26449){printf("26459\n");return 0;}
else if(x>26437){printf("26449\n");return 0;}
else if(x>26431){printf("26437\n");return 0;}
else if(x>26423){printf("26431\n");return 0;}
else if(x>26417){printf("26423\n");return 0;}
else if(x>26407){printf("26417\n");return 0;}
else if(x>26399){printf("26407\n");return 0;}
else if(x>26393){printf("26399\n");return 0;}
else if(x>26387){printf("26393\n");return 0;}
else if(x>26371){printf("26387\n");return 0;}
else if(x>26357){printf("26371\n");return 0;}
else if(x>26347){printf("26357\n");return 0;}
else if(x>26339){printf("26347\n");return 0;}
else if(x>26321){printf("26339\n");return 0;}
else if(x>26317){printf("26321\n");return 0;}
else if(x>26309){printf("26317\n");return 0;}
else if(x>26297){printf("26309\n");return 0;}
else if(x>26293){printf("26297\n");return 0;}
else if(x>26267){printf("26293\n");return 0;}
else if(x>26263){printf("26267\n");return 0;}
else if(x>26261){printf("26263\n");return 0;}
else if(x>26251){printf("26261\n");return 0;}
else if(x>26249){printf("26251\n");return 0;}
else if(x>26237){printf("26249\n");return 0;}
else if(x>26227){printf("26237\n");return 0;}
else if(x>26209){printf("26227\n");return 0;}
else if(x>26203){printf("26209\n");return 0;}
else if(x>26189){printf("26203\n");return 0;}
else if(x>26183){printf("26189\n");return 0;}
else if(x>26177){printf("26183\n");return 0;}
else if(x>26171){printf("26177\n");return 0;}
else if(x>26161){printf("26171\n");return 0;}
else if(x>26153){printf("26161\n");return 0;}
else if(x>26141){printf("26153\n");return 0;}
else if(x>26119){printf("26141\n");return 0;}
else if(x>26113){printf("26119\n");return 0;}
else if(x>26111){printf("26113\n");return 0;}
else if(x>26107){printf("26111\n");return 0;}
else if(x>26099){printf("26107\n");return 0;}
else if(x>26083){printf("26099\n");return 0;}
else if(x>26053){printf("26083\n");return 0;}
else if(x>26041){printf("26053\n");return 0;}
else if(x>26029){printf("26041\n");return 0;}
else if(x>26021){printf("26029\n");return 0;}
else if(x>26017){printf("26021\n");return 0;}
else if(x>26003){printf("26017\n");return 0;}
else if(x>25999){printf("26003\n");return 0;}
else if(x>25997){printf("25999\n");return 0;}
else if(x>25981){printf("25997\n");return 0;}
else if(x>25969){printf("25981\n");return 0;}
else if(x>25951){printf("25969\n");return 0;}
else if(x>25943){printf("25951\n");return 0;}
else if(x>25939){printf("25943\n");return 0;}
else if(x>25933){printf("25939\n");return 0;}
else if(x>25931){printf("25933\n");return 0;}
else if(x>25919){printf("25931\n");return 0;}
else if(x>25913){printf("25919\n");return 0;}
else if(x>25903){printf("25913\n");return 0;}
else if(x>25889){printf("25903\n");return 0;}
else if(x>25873){printf("25889\n");return 0;}
else if(x>25867){printf("25873\n");return 0;}
else if(x>25849){printf("25867\n");return 0;}
else if(x>25847){printf("25849\n");return 0;}
else if(x>25841){printf("25847\n");return 0;}
else if(x>25819){printf("25841\n");return 0;}
else if(x>25801){printf("25819\n");return 0;}
else if(x>25799){printf("25801\n");return 0;}
else if(x>25793){printf("25799\n");return 0;}
else if(x>25771){printf("25793\n");return 0;}
else if(x>25763){printf("25771\n");return 0;}
else if(x>25759){printf("25763\n");return 0;}
else if(x>25747){printf("25759\n");return 0;}
else if(x>25741){printf("25747\n");return 0;}
else if(x>25733){printf("25741\n");return 0;}
else if(x>25717){printf("25733\n");return 0;}
else if(x>25703){printf("25717\n");return 0;}
else if(x>25693){printf("25703\n");return 0;}
else if(x>25679){printf("25693\n");return 0;}
else if(x>25673){printf("25679\n");return 0;}
else if(x>25667){printf("25673\n");return 0;}
else if(x>25657){printf("25667\n");return 0;}
else if(x>25643){printf("25657\n");return 0;}
else if(x>25639){printf("25643\n");return 0;}
else if(x>25633){printf("25639\n");return 0;}
else if(x>25621){printf("25633\n");return 0;}
else if(x>25609){printf("25621\n");return 0;}
else if(x>25603){printf("25609\n");return 0;}
else if(x>25601){printf("25603\n");return 0;}
else if(x>25589){printf("25601\n");return 0;}
else if(x>25583){printf("25589\n");return 0;}
else if(x>25579){printf("25583\n");return 0;}
else if(x>25577){printf("25579\n");return 0;}
else if(x>25561){printf("25577\n");return 0;}
else if(x>25541){printf("25561\n");return 0;}
else if(x>25537){printf("25541\n");return 0;}
else if(x>25523){printf("25537\n");return 0;}
else if(x>25471){printf("25523\n");return 0;}
else if(x>25469){printf("25471\n");return 0;}
else if(x>25463){printf("25469\n");return 0;}
else if(x>25457){printf("25463\n");return 0;}
else if(x>25453){printf("25457\n");return 0;}
else if(x>25447){printf("25453\n");return 0;}
else if(x>25439){printf("25447\n");return 0;}
else if(x>25423){printf("25439\n");return 0;}
else if(x>25411){printf("25423\n");return 0;}
else if(x>25409){printf("25411\n");return 0;}
else if(x>25391){printf("25409\n");return 0;}
else if(x>25373){printf("25391\n");return 0;}
else if(x>25367){printf("25373\n");return 0;}
else if(x>25357){printf("25367\n");return 0;}
else if(x>25349){printf("25357\n");return 0;}
else if(x>25343){printf("25349\n");return 0;}
else if(x>25339){printf("25343\n");return 0;}
else if(x>25321){printf("25339\n");return 0;}
else if(x>25309){printf("25321\n");return 0;}
else if(x>25307){printf("25309\n");return 0;}
else if(x>25303){printf("25307\n");return 0;}
else if(x>25301){printf("25303\n");return 0;}
else if(x>25261){printf("25301\n");return 0;}
else if(x>25253){printf("25261\n");return 0;}
else if(x>25247){printf("25253\n");return 0;}
else if(x>25243){printf("25247\n");return 0;}
else if(x>25237){printf("25243\n");return 0;}
else if(x>25229){printf("25237\n");return 0;}
else if(x>25219){printf("25229\n");return 0;}
else if(x>25189){printf("25219\n");return 0;}
else if(x>25183){printf("25189\n");return 0;}
else if(x>25171){printf("25183\n");return 0;}
else if(x>25169){printf("25171\n");return 0;}
else if(x>25163){printf("25169\n");return 0;}
else if(x>25153){printf("25163\n");return 0;}
else if(x>25147){printf("25153\n");return 0;}
else if(x>25127){printf("25147\n");return 0;}
else if(x>25121){printf("25127\n");return 0;}
else if(x>25117){printf("25121\n");return 0;}
else if(x>25111){printf("25117\n");return 0;}
else if(x>25097){printf("25111\n");return 0;}
else if(x>25087){printf("25097\n");return 0;}
else if(x>25073){printf("25087\n");return 0;}
else if(x>25057){printf("25073\n");return 0;}
else if(x>25037){printf("25057\n");return 0;}
else if(x>25033){printf("25037\n");return 0;}
else if(x>25031){printf("25033\n");return 0;}
else if(x>25013){printf("25031\n");return 0;}
else if(x>24989){printf("25013\n");return 0;}
else if(x>24979){printf("24989\n");return 0;}
else if(x>24977){printf("24979\n");return 0;}
else if(x>24971){printf("24977\n");return 0;}
else if(x>24967){printf("24971\n");return 0;}
else if(x>24953){printf("24967\n");return 0;}
else if(x>24943){printf("24953\n");return 0;}
else if(x>24923){printf("24943\n");return 0;}
else if(x>24919){printf("24923\n");return 0;}
else if(x>24917){printf("24919\n");return 0;}
else if(x>24907){printf("24917\n");return 0;}
else if(x>24889){printf("24907\n");return 0;}
else if(x>24877){printf("24889\n");return 0;}
else if(x>24859){printf("24877\n");return 0;}
else if(x>24851){printf("24859\n");return 0;}
else if(x>24847){printf("24851\n");return 0;}
else if(x>24841){printf("24847\n");return 0;}
else if(x>24821){printf("24841\n");return 0;}
else if(x>24809){printf("24821\n");return 0;}
else if(x>24799){printf("24809\n");return 0;}
else if(x>24793){printf("24799\n");return 0;}
else if(x>24781){printf("24793\n");return 0;}
else if(x>24767){printf("24781\n");return 0;}
else if(x>24763){printf("24767\n");return 0;}
else if(x>24749){printf("24763\n");return 0;}
else if(x>24733){printf("24749\n");return 0;}
else if(x>24709){printf("24733\n");return 0;}
else if(x>24697){printf("24709\n");return 0;}
else if(x>24691){printf("24697\n");return 0;}
else if(x>24683){printf("24691\n");return 0;}
else if(x>24677){printf("24683\n");return 0;}
else if(x>24671){printf("24677\n");return 0;}
else if(x>24659){printf("24671\n");return 0;}
else if(x>24631){printf("24659\n");return 0;}
else if(x>24623){printf("24631\n");return 0;}
else if(x>24611){printf("24623\n");return 0;}
else if(x>24593){printf("24611\n");return 0;}
else if(x>24571){printf("24593\n");return 0;}
else if(x>24551){printf("24571\n");return 0;}
else if(x>24547){printf("24551\n");return 0;}
else if(x>24533){printf("24547\n");return 0;}
else if(x>24527){printf("24533\n");return 0;}
else if(x>24517){printf("24527\n");return 0;}
else if(x>24509){printf("24517\n");return 0;}
else if(x>24499){printf("24509\n");return 0;}
else if(x>24481){printf("24499\n");return 0;}
else if(x>24473){printf("24481\n");return 0;}
else if(x>24469){printf("24473\n");return 0;}
else if(x>24443){printf("24469\n");return 0;}
else if(x>24439){printf("24443\n");return 0;}
else if(x>24421){printf("24439\n");return 0;}
else if(x>24419){printf("24421\n");return 0;}
else if(x>24413){printf("24419\n");return 0;}
else if(x>24407){printf("24413\n");return 0;}
else if(x>24391){printf("24407\n");return 0;}
else if(x>24379){printf("24391\n");return 0;}
else if(x>24373){printf("24379\n");return 0;}
else if(x>24371){printf("24373\n");return 0;}
else if(x>24359){printf("24371\n");return 0;}
else if(x>24337){printf("24359\n");return 0;}
else if(x>24329){printf("24337\n");return 0;}
else if(x>24317){printf("24329\n");return 0;}
else if(x>24281){printf("24317\n");return 0;}
else if(x>24251){printf("24281\n");return 0;}
else if(x>24247){printf("24251\n");return 0;}
else if(x>24239){printf("24247\n");return 0;}
else if(x>24229){printf("24239\n");return 0;}
else if(x>24223){printf("24229\n");return 0;}
else if(x>24203){printf("24223\n");return 0;}
else if(x>24197){printf("24203\n");return 0;}
else if(x>24181){printf("24197\n");return 0;}
else if(x>24179){printf("24181\n");return 0;}
else if(x>24169){printf("24179\n");return 0;}
else if(x>24151){printf("24169\n");return 0;}
else if(x>24137){printf("24151\n");return 0;}
else if(x>24133){printf("24137\n");return 0;}
else if(x>24121){printf("24133\n");return 0;}
else if(x>24113){printf("24121\n");return 0;}
else if(x>24109){printf("24113\n");return 0;}
else if(x>24107){printf("24109\n");return 0;}
else if(x>24103){printf("24107\n");return 0;}
else if(x>24097){printf("24103\n");return 0;}
else if(x>24091){printf("24097\n");return 0;}
else if(x>24083){printf("24091\n");return 0;}
else if(x>24077){printf("24083\n");return 0;}
else if(x>24071){printf("24077\n");return 0;}
else if(x>24061){printf("24071\n");return 0;}
else if(x>24049){printf("24061\n");return 0;}
else if(x>24043){printf("24049\n");return 0;}
else if(x>24029){printf("24043\n");return 0;}
else if(x>24023){printf("24029\n");return 0;}
else if(x>24019){printf("24023\n");return 0;}
else if(x>24007){printf("24019\n");return 0;}
else if(x>24001){printf("24007\n");return 0;}
else if(x>23993){printf("24001\n");return 0;}
else if(x>23981){printf("23993\n");return 0;}
else if(x>23977){printf("23981\n");return 0;}
else if(x>23971){printf("23977\n");return 0;}
else if(x>23957){printf("23971\n");return 0;}
else if(x>23929){printf("23957\n");return 0;}
else if(x>23917){printf("23929\n");return 0;}
else if(x>23911){printf("23917\n");return 0;}
else if(x>23909){printf("23911\n");return 0;}
else if(x>23899){printf("23909\n");return 0;}
else if(x>23893){printf("23899\n");return 0;}
else if(x>23887){printf("23893\n");return 0;}
else if(x>23879){printf("23887\n");return 0;}
else if(x>23873){printf("23879\n");return 0;}
else if(x>23869){printf("23873\n");return 0;}
else if(x>23857){printf("23869\n");return 0;}
else if(x>23833){printf("23857\n");return 0;}
else if(x>23831){printf("23833\n");return 0;}
else if(x>23827){printf("23831\n");return 0;}
else if(x>23819){printf("23827\n");return 0;}
else if(x>23813){printf("23819\n");return 0;}
else if(x>23801){printf("23813\n");return 0;}
else if(x>23789){printf("23801\n");return 0;}
else if(x>23773){printf("23789\n");return 0;}
else if(x>23767){printf("23773\n");return 0;}
else if(x>23761){printf("23767\n");return 0;}
else if(x>23753){printf("23761\n");return 0;}
else if(x>23747){printf("23753\n");return 0;}
else if(x>23743){printf("23747\n");return 0;}
else if(x>23741){printf("23743\n");return 0;}
else if(x>23719){printf("23741\n");return 0;}
else if(x>23689){printf("23719\n");return 0;}
else if(x>23687){printf("23689\n");return 0;}
else if(x>23677){printf("23687\n");return 0;}
else if(x>23671){printf("23677\n");return 0;}
else if(x>23669){printf("23671\n");return 0;}
else if(x>23663){printf("23669\n");return 0;}
else if(x>23633){printf("23663\n");return 0;}
else if(x>23629){printf("23633\n");return 0;}
else if(x>23627){printf("23629\n");return 0;}
else if(x>23623){printf("23627\n");return 0;}
else if(x>23609){printf("23623\n");return 0;}
else if(x>23603){printf("23609\n");return 0;}
else if(x>23599){printf("23603\n");return 0;}
else if(x>23593){printf("23599\n");return 0;}
else if(x>23581){printf("23593\n");return 0;}
else if(x>23567){printf("23581\n");return 0;}
else if(x>23563){printf("23567\n");return 0;}
else if(x>23561){printf("23563\n");return 0;}
else if(x>23557){printf("23561\n");return 0;}
else if(x>23549){printf("23557\n");return 0;}
else if(x>23539){printf("23549\n");return 0;}
else if(x>23537){printf("23539\n");return 0;}
else if(x>23531){printf("23537\n");return 0;}
else if(x>23509){printf("23531\n");return 0;}
else if(x>23497){printf("23509\n");return 0;}
else if(x>23473){printf("23497\n");return 0;}
else if(x>23459){printf("23473\n");return 0;}
else if(x>23447){printf("23459\n");return 0;}
else if(x>23431){printf("23447\n");return 0;}
else if(x>23417){printf("23431\n");return 0;}
else if(x>23399){printf("23417\n");return 0;}
else if(x>23371){printf("23399\n");return 0;}
else if(x>23369){printf("23371\n");return 0;}
else if(x>23357){printf("23369\n");return 0;}
else if(x>23339){printf("23357\n");return 0;}
else if(x>23333){printf("23339\n");return 0;}
else if(x>23327){printf("23333\n");return 0;}
else if(x>23321){printf("23327\n");return 0;}
else if(x>23311){printf("23321\n");return 0;}
else if(x>23297){printf("23311\n");return 0;}
else if(x>23293){printf("23297\n");return 0;}
else if(x>23291){printf("23293\n");return 0;}
else if(x>23279){printf("23291\n");return 0;}
else if(x>23269){printf("23279\n");return 0;}
else if(x>23251){printf("23269\n");return 0;}
else if(x>23227){printf("23251\n");return 0;}
else if(x>23209){printf("23227\n");return 0;}
else if(x>23203){printf("23209\n");return 0;}
else if(x>23201){printf("23203\n");return 0;}
else if(x>23197){printf("23201\n");return 0;}
else if(x>23189){printf("23197\n");return 0;}
else if(x>23173){printf("23189\n");return 0;}
else if(x>23167){printf("23173\n");return 0;}
else if(x>23159){printf("23167\n");return 0;}
else if(x>23143){printf("23159\n");return 0;}
else if(x>23131){printf("23143\n");return 0;}
else if(x>23117){printf("23131\n");return 0;}
else if(x>23099){printf("23117\n");return 0;}
else if(x>23087){printf("23099\n");return 0;}
else if(x>23081){printf("23087\n");return 0;}
else if(x>23071){printf("23081\n");return 0;}
else if(x>23063){printf("23071\n");return 0;}
else if(x>23059){printf("23063\n");return 0;}
else if(x>23057){printf("23059\n");return 0;}
else if(x>23053){printf("23057\n");return 0;}
else if(x>23041){printf("23053\n");return 0;}
else if(x>23039){printf("23041\n");return 0;}
else if(x>23029){printf("23039\n");return 0;}
else if(x>23027){printf("23029\n");return 0;}
else if(x>23021){printf("23027\n");return 0;}
else if(x>23017){printf("23021\n");return 0;}
else if(x>23011){printf("23017\n");return 0;}
else if(x>23003){printf("23011\n");return 0;}
else if(x>22993){printf("23003\n");return 0;}
else if(x>22973){printf("22993\n");return 0;}
else if(x>22963){printf("22973\n");return 0;}
else if(x>22961){printf("22963\n");return 0;}
else if(x>22943){printf("22961\n");return 0;}
else if(x>22937){printf("22943\n");return 0;}
else if(x>22921){printf("22937\n");return 0;}
else if(x>22907){printf("22921\n");return 0;}
else if(x>22901){printf("22907\n");return 0;}
else if(x>22877){printf("22901\n");return 0;}
else if(x>22871){printf("22877\n");return 0;}
else if(x>22861){printf("22871\n");return 0;}
else if(x>22859){printf("22861\n");return 0;}
else if(x>22853){printf("22859\n");return 0;}
else if(x>22817){printf("22853\n");return 0;}
else if(x>22811){printf("22817\n");return 0;}
else if(x>22807){printf("22811\n");return 0;}
else if(x>22787){printf("22807\n");return 0;}
else if(x>22783){printf("22787\n");return 0;}
else if(x>22777){printf("22783\n");return 0;}
else if(x>22769){printf("22777\n");return 0;}
else if(x>22751){printf("22769\n");return 0;}
else if(x>22741){printf("22751\n");return 0;}
else if(x>22739){printf("22741\n");return 0;}
else if(x>22727){printf("22739\n");return 0;}
else if(x>22721){printf("22727\n");return 0;}
else if(x>22717){printf("22721\n");return 0;}
else if(x>22709){printf("22717\n");return 0;}
else if(x>22699){printf("22709\n");return 0;}
else if(x>22697){printf("22699\n");return 0;}
else if(x>22691){printf("22697\n");return 0;}
else if(x>22679){printf("22691\n");return 0;}
else if(x>22669){printf("22679\n");return 0;}
else if(x>22651){printf("22669\n");return 0;}
else if(x>22643){printf("22651\n");return 0;}
else if(x>22639){printf("22643\n");return 0;}
else if(x>22637){printf("22639\n");return 0;}
else if(x>22621){printf("22637\n");return 0;}
else if(x>22619){printf("22621\n");return 0;}
else if(x>22613){printf("22619\n");return 0;}
else if(x>22573){printf("22613\n");return 0;}
else if(x>22571){printf("22573\n");return 0;}
else if(x>22567){printf("22571\n");return 0;}
else if(x>22549){printf("22567\n");return 0;}
else if(x>22543){printf("22549\n");return 0;}
else if(x>22541){printf("22543\n");return 0;}
else if(x>22531){printf("22541\n");return 0;}
else if(x>22511){printf("22531\n");return 0;}
else if(x>22501){printf("22511\n");return 0;}
else if(x>22483){printf("22501\n");return 0;}
else if(x>22481){printf("22483\n");return 0;}
else if(x>22469){printf("22481\n");return 0;}
else if(x>22453){printf("22469\n");return 0;}
else if(x>22447){printf("22453\n");return 0;}
else if(x>22441){printf("22447\n");return 0;}
else if(x>22433){printf("22441\n");return 0;}
else if(x>22409){printf("22433\n");return 0;}
else if(x>22397){printf("22409\n");return 0;}
else if(x>22391){printf("22397\n");return 0;}
else if(x>22381){printf("22391\n");return 0;}
else if(x>22369){printf("22381\n");return 0;}
else if(x>22367){printf("22369\n");return 0;}
else if(x>22349){printf("22367\n");return 0;}
else if(x>22343){printf("22349\n");return 0;}
else if(x>22307){printf("22343\n");return 0;}
else if(x>22303){printf("22307\n");return 0;}
else if(x>22291){printf("22303\n");return 0;}
else if(x>22283){printf("22291\n");return 0;}
else if(x>22279){printf("22283\n");return 0;}
else if(x>22277){printf("22279\n");return 0;}
else if(x>22273){printf("22277\n");return 0;}
else if(x>22271){printf("22273\n");return 0;}
else if(x>22259){printf("22271\n");return 0;}
else if(x>22247){printf("22259\n");return 0;}
else if(x>22229){printf("22247\n");return 0;}
else if(x>22193){printf("22229\n");return 0;}
else if(x>22189){printf("22193\n");return 0;}
else if(x>22171){printf("22189\n");return 0;}
else if(x>22159){printf("22171\n");return 0;}
else if(x>22157){printf("22159\n");return 0;}
else if(x>22153){printf("22157\n");return 0;}
else if(x>22147){printf("22153\n");return 0;}
else if(x>22133){printf("22147\n");return 0;}
else if(x>22129){printf("22133\n");return 0;}
else if(x>22123){printf("22129\n");return 0;}
else if(x>22111){printf("22123\n");return 0;}
else if(x>22109){printf("22111\n");return 0;}
else if(x>22093){printf("22109\n");return 0;}
else if(x>22091){printf("22093\n");return 0;}
else if(x>22079){printf("22091\n");return 0;}
else if(x>22073){printf("22079\n");return 0;}
else if(x>22067){printf("22073\n");return 0;}
else if(x>22063){printf("22067\n");return 0;}
else if(x>22051){printf("22063\n");return 0;}
else if(x>22039){printf("22051\n");return 0;}
else if(x>22037){printf("22039\n");return 0;}
else if(x>22031){printf("22037\n");return 0;}
else if(x>22027){printf("22031\n");return 0;}
else if(x>22013){printf("22027\n");return 0;}
else if(x>22003){printf("22013\n");return 0;}
else if(x>21997){printf("22003\n");return 0;}
else if(x>21991){printf("21997\n");return 0;}
else if(x>21977){printf("21991\n");return 0;}
else if(x>21961){printf("21977\n");return 0;}
else if(x>21943){printf("21961\n");return 0;}
else if(x>21937){printf("21943\n");return 0;}
else if(x>21929){printf("21937\n");return 0;}
else if(x>21911){printf("21929\n");return 0;}
else if(x>21893){printf("21911\n");return 0;}
else if(x>21881){printf("21893\n");return 0;}
else if(x>21871){printf("21881\n");return 0;}
else if(x>21863){printf("21871\n");return 0;}
else if(x>21859){printf("21863\n");return 0;}
else if(x>21851){printf("21859\n");return 0;}
else if(x>21841){printf("21851\n");return 0;}
else if(x>21839){printf("21841\n");return 0;}
else if(x>21821){printf("21839\n");return 0;}
else if(x>21817){printf("21821\n");return 0;}
else if(x>21803){printf("21817\n");return 0;}
else if(x>21799){printf("21803\n");return 0;}
else if(x>21787){printf("21799\n");return 0;}
else if(x>21773){printf("21787\n");return 0;}
else if(x>21767){printf("21773\n");return 0;}
else if(x>21757){printf("21767\n");return 0;}
else if(x>21751){printf("21757\n");return 0;}
else if(x>21739){printf("21751\n");return 0;}
else if(x>21737){printf("21739\n");return 0;}
else if(x>21727){printf("21737\n");return 0;}
else if(x>21713){printf("21727\n");return 0;}
else if(x>21701){printf("21713\n");return 0;}
else if(x>21683){printf("21701\n");return 0;}
else if(x>21673){printf("21683\n");return 0;}
else if(x>21661){printf("21673\n");return 0;}
else if(x>21649){printf("21661\n");return 0;}
else if(x>21647){printf("21649\n");return 0;}
else if(x>21617){printf("21647\n");return 0;}
else if(x>21613){printf("21617\n");return 0;}
else if(x>21611){printf("21613\n");return 0;}
else if(x>21601){printf("21611\n");return 0;}
else if(x>21599){printf("21601\n");return 0;}
else if(x>21589){printf("21599\n");return 0;}
else if(x>21587){printf("21589\n");return 0;}
else if(x>21577){printf("21587\n");return 0;}
else if(x>21569){printf("21577\n");return 0;}
else if(x>21563){printf("21569\n");return 0;}
else if(x>21559){printf("21563\n");return 0;}
else if(x>21557){printf("21559\n");return 0;}
else if(x>21529){printf("21557\n");return 0;}
else if(x>21523){printf("21529\n");return 0;}
else if(x>21521){printf("21523\n");return 0;}
else if(x>21517){printf("21521\n");return 0;}
else if(x>21503){printf("21517\n");return 0;}
else if(x>21499){printf("21503\n");return 0;}
else if(x>21493){printf("21499\n");return 0;}
else if(x>21491){printf("21493\n");return 0;}
else if(x>21487){printf("21491\n");return 0;}
else if(x>21481){printf("21487\n");return 0;}
else if(x>21467){printf("21481\n");return 0;}
else if(x>21433){printf("21467\n");return 0;}
else if(x>21419){printf("21433\n");return 0;}
else if(x>21407){printf("21419\n");return 0;}
else if(x>21401){printf("21407\n");return 0;}
else if(x>21397){printf("21401\n");return 0;}
else if(x>21391){printf("21397\n");return 0;}
else if(x>21383){printf("21391\n");return 0;}
else if(x>21379){printf("21383\n");return 0;}
else if(x>21377){printf("21379\n");return 0;}
else if(x>21347){printf("21377\n");return 0;}
else if(x>21341){printf("21347\n");return 0;}
else if(x>21323){printf("21341\n");return 0;}
else if(x>21319){printf("21323\n");return 0;}
else if(x>21317){printf("21319\n");return 0;}
else if(x>21313){printf("21317\n");return 0;}
else if(x>21283){printf("21313\n");return 0;}
else if(x>21277){printf("21283\n");return 0;}
else if(x>21269){printf("21277\n");return 0;}
else if(x>21247){printf("21269\n");return 0;}
else if(x>21227){printf("21247\n");return 0;}
else if(x>21221){printf("21227\n");return 0;}
else if(x>21211){printf("21221\n");return 0;}
else if(x>21193){printf("21211\n");return 0;}
else if(x>21191){printf("21193\n");return 0;}
else if(x>21187){printf("21191\n");return 0;}
else if(x>21179){printf("21187\n");return 0;}
else if(x>21169){printf("21179\n");return 0;}
else if(x>21163){printf("21169\n");return 0;}
else if(x>21157){printf("21163\n");return 0;}
else if(x>21149){printf("21157\n");return 0;}
else if(x>21143){printf("21149\n");return 0;}
else if(x>21139){printf("21143\n");return 0;}
else if(x>21121){printf("21139\n");return 0;}
else if(x>21107){printf("21121\n");return 0;}
else if(x>21101){printf("21107\n");return 0;}
else if(x>21089){printf("21101\n");return 0;}
else if(x>21067){printf("21089\n");return 0;}
else if(x>21061){printf("21067\n");return 0;}
else if(x>21059){printf("21061\n");return 0;}
else if(x>21031){printf("21059\n");return 0;}
else if(x>21023){printf("21031\n");return 0;}
else if(x>21019){printf("21023\n");return 0;}
else if(x>21017){printf("21019\n");return 0;}
else if(x>21013){printf("21017\n");return 0;}
else if(x>21011){printf("21013\n");return 0;}
else if(x>21001){printf("21011\n");return 0;}
else if(x>20983){printf("21001\n");return 0;}
else if(x>20981){printf("20983\n");return 0;}
else if(x>20963){printf("20981\n");return 0;}
else if(x>20959){printf("20963\n");return 0;}
else if(x>20947){printf("20959\n");return 0;}
else if(x>20939){printf("20947\n");return 0;}
else if(x>20929){printf("20939\n");return 0;}
else if(x>20921){printf("20929\n");return 0;}
else if(x>20903){printf("20921\n");return 0;}
else if(x>20899){printf("20903\n");return 0;}
else if(x>20897){printf("20899\n");return 0;}
else if(x>20887){printf("20897\n");return 0;}
else if(x>20879){printf("20887\n");return 0;}
else if(x>20873){printf("20879\n");return 0;}
else if(x>20857){printf("20873\n");return 0;}
else if(x>20849){printf("20857\n");return 0;}
else if(x>20809){printf("20849\n");return 0;}
else if(x>20807){printf("20809\n");return 0;}
else if(x>20789){printf("20807\n");return 0;}
else if(x>20773){printf("20789\n");return 0;}
else if(x>20771){printf("20773\n");return 0;}
else if(x>20759){printf("20771\n");return 0;}
else if(x>20753){printf("20759\n");return 0;}
else if(x>20749){printf("20753\n");return 0;}
else if(x>20747){printf("20749\n");return 0;}
else if(x>20743){printf("20747\n");return 0;}
else if(x>20731){printf("20743\n");return 0;}
else if(x>20719){printf("20731\n");return 0;}
else if(x>20717){printf("20719\n");return 0;}
else if(x>20707){printf("20717\n");return 0;}
else if(x>20693){printf("20707\n");return 0;}
else if(x>20681){printf("20693\n");return 0;}
else if(x>20663){printf("20681\n");return 0;}
else if(x>20641){printf("20663\n");return 0;}
else if(x>20639){printf("20641\n");return 0;}
else if(x>20627){printf("20639\n");return 0;}
else if(x>20611){printf("20627\n");return 0;}
else if(x>20599){printf("20611\n");return 0;}
else if(x>20593){printf("20599\n");return 0;}
else if(x>20563){printf("20593\n");return 0;}
else if(x>20551){printf("20563\n");return 0;}
else if(x>20549){printf("20551\n");return 0;}
else if(x>20543){printf("20549\n");return 0;}
else if(x>20533){printf("20543\n");return 0;}
else if(x>20521){printf("20533\n");return 0;}
else if(x>20509){printf("20521\n");return 0;}
else if(x>20507){printf("20509\n");return 0;}
else if(x>20483){printf("20507\n");return 0;}
else if(x>20479){printf("20483\n");return 0;}
else if(x>20477){printf("20479\n");return 0;}
else if(x>20443){printf("20477\n");return 0;}
else if(x>20441){printf("20443\n");return 0;}
else if(x>20431){printf("20441\n");return 0;}
else if(x>20411){printf("20431\n");return 0;}
else if(x>20407){printf("20411\n");return 0;}
else if(x>20399){printf("20407\n");return 0;}
else if(x>20393){printf("20399\n");return 0;}
else if(x>20389){printf("20393\n");return 0;}
else if(x>20369){printf("20389\n");return 0;}
else if(x>20359){printf("20369\n");return 0;}
else if(x>20357){printf("20359\n");return 0;}
else if(x>20353){printf("20357\n");return 0;}
else if(x>20347){printf("20353\n");return 0;}
else if(x>20341){printf("20347\n");return 0;}
else if(x>20333){printf("20341\n");return 0;}
else if(x>20327){printf("20333\n");return 0;}
else if(x>20323){printf("20327\n");return 0;}
else if(x>20297){printf("20323\n");return 0;}
else if(x>20287){printf("20297\n");return 0;}
else if(x>20269){printf("20287\n");return 0;}
else if(x>20261){printf("20269\n");return 0;}
else if(x>20249){printf("20261\n");return 0;}
else if(x>20233){printf("20249\n");return 0;}
else if(x>20231){printf("20233\n");return 0;}
else if(x>20219){printf("20231\n");return 0;}
else if(x>20201){printf("20219\n");return 0;}
else if(x>20183){printf("20201\n");return 0;}
else if(x>20177){printf("20183\n");return 0;}
else if(x>20173){printf("20177\n");return 0;}
else if(x>20161){printf("20173\n");return 0;}
else if(x>20149){printf("20161\n");return 0;}
else if(x>20147){printf("20149\n");return 0;}
else if(x>20143){printf("20147\n");return 0;}
else if(x>20129){printf("20143\n");return 0;}
else if(x>20123){printf("20129\n");return 0;}
else if(x>20117){printf("20123\n");return 0;}
else if(x>20113){printf("20117\n");return 0;}
else if(x>20107){printf("20113\n");return 0;}
else if(x>20101){printf("20107\n");return 0;}
else if(x>20089){printf("20101\n");return 0;}
else if(x>20071){printf("20089\n");return 0;}
else if(x>20063){printf("20071\n");return 0;}
else if(x>20051){printf("20063\n");return 0;}
else if(x>20047){printf("20051\n");return 0;}
else if(x>20029){printf("20047\n");return 0;}
else if(x>20023){printf("20029\n");return 0;}
else if(x>20021){printf("20023\n");return 0;}
else if(x>20011){printf("20021\n");return 0;}
else if(x>19997){printf("20011\n");return 0;}
else if(x>19993){printf("19997\n");return 0;}
else if(x>19991){printf("19993\n");return 0;}
else if(x>19979){printf("19991\n");return 0;}
else if(x>19973){printf("19979\n");return 0;}
else if(x>19963){printf("19973\n");return 0;}
else if(x>19961){printf("19963\n");return 0;}
else if(x>19949){printf("19961\n");return 0;}
else if(x>19937){printf("19949\n");return 0;}
else if(x>19927){printf("19937\n");return 0;}
else if(x>19919){printf("19927\n");return 0;}
else if(x>19913){printf("19919\n");return 0;}
else if(x>19891){printf("19913\n");return 0;}
else if(x>19889){printf("19891\n");return 0;}
else if(x>19867){printf("19889\n");return 0;}
else if(x>19861){printf("19867\n");return 0;}
else if(x>19853){printf("19861\n");return 0;}
else if(x>19843){printf("19853\n");return 0;}
else if(x>19841){printf("19843\n");return 0;}
else if(x>19819){printf("19841\n");return 0;}
else if(x>19813){printf("19819\n");return 0;}
else if(x>19801){printf("19813\n");return 0;}
else if(x>19793){printf("19801\n");return 0;}
else if(x>19777){printf("19793\n");return 0;}
else if(x>19763){printf("19777\n");return 0;}
else if(x>19759){printf("19763\n");return 0;}
else if(x>19753){printf("19759\n");return 0;}
else if(x>19751){printf("19753\n");return 0;}
else if(x>19739){printf("19751\n");return 0;}
else if(x>19727){printf("19739\n");return 0;}
else if(x>19717){printf("19727\n");return 0;}
else if(x>19709){printf("19717\n");return 0;}
else if(x>19699){printf("19709\n");return 0;}
else if(x>19697){printf("19699\n");return 0;}
else if(x>19687){printf("19697\n");return 0;}
else if(x>19681){printf("19687\n");return 0;}
else if(x>19661){printf("19681\n");return 0;}
else if(x>19609){printf("19661\n");return 0;}
else if(x>19603){printf("19609\n");return 0;}
else if(x>19597){printf("19603\n");return 0;}
else if(x>19583){printf("19597\n");return 0;}
else if(x>19577){printf("19583\n");return 0;}
else if(x>19571){printf("19577\n");return 0;}
else if(x>19559){printf("19571\n");return 0;}
else if(x>19553){printf("19559\n");return 0;}
else if(x>19543){printf("19553\n");return 0;}
else if(x>19541){printf("19543\n");return 0;}
else if(x>19531){printf("19541\n");return 0;}
else if(x>19507){printf("19531\n");return 0;}
else if(x>19501){printf("19507\n");return 0;}
else if(x>19489){printf("19501\n");return 0;}
else if(x>19483){printf("19489\n");return 0;}
else if(x>19477){printf("19483\n");return 0;}
else if(x>19471){printf("19477\n");return 0;}
else if(x>19469){printf("19471\n");return 0;}
else if(x>19463){printf("19469\n");return 0;}
else if(x>19457){printf("19463\n");return 0;}
else if(x>19447){printf("19457\n");return 0;}
else if(x>19441){printf("19447\n");return 0;}
else if(x>19433){printf("19441\n");return 0;}
else if(x>19429){printf("19433\n");return 0;}
else if(x>19427){printf("19429\n");return 0;}
else if(x>19423){printf("19427\n");return 0;}
else if(x>19421){printf("19423\n");return 0;}
else if(x>19417){printf("19421\n");return 0;}
else if(x>19403){printf("19417\n");return 0;}
else if(x>19391){printf("19403\n");return 0;}
else if(x>19387){printf("19391\n");return 0;}
else if(x>19381){printf("19387\n");return 0;}
else if(x>19379){printf("19381\n");return 0;}
else if(x>19373){printf("19379\n");return 0;}
else if(x>19333){printf("19373\n");return 0;}
else if(x>19319){printf("19333\n");return 0;}
else if(x>19309){printf("19319\n");return 0;}
else if(x>19301){printf("19309\n");return 0;}
else if(x>19289){printf("19301\n");return 0;}
else if(x>19273){printf("19289\n");return 0;}
else if(x>19267){printf("19273\n");return 0;}
else if(x>19259){printf("19267\n");return 0;}
else if(x>19249){printf("19259\n");return 0;}
else if(x>19237){printf("19249\n");return 0;}
else if(x>19231){printf("19237\n");return 0;}
else if(x>19219){printf("19231\n");return 0;}
else if(x>19213){printf("19219\n");return 0;}
else if(x>19211){printf("19213\n");return 0;}
else if(x>19207){printf("19211\n");return 0;}
else if(x>19183){printf("19207\n");return 0;}
else if(x>19181){printf("19183\n");return 0;}
else if(x>19163){printf("19181\n");return 0;}
else if(x>19157){printf("19163\n");return 0;}
else if(x>19141){printf("19157\n");return 0;}
else if(x>19139){printf("19141\n");return 0;}
else if(x>19121){printf("19139\n");return 0;}
else if(x>19087){printf("19121\n");return 0;}
else if(x>19081){printf("19087\n");return 0;}
else if(x>19079){printf("19081\n");return 0;}
else if(x>19073){printf("19079\n");return 0;}
else if(x>19069){printf("19073\n");return 0;}
else if(x>19051){printf("19069\n");return 0;}
else if(x>19037){printf("19051\n");return 0;}
else if(x>19031){printf("19037\n");return 0;}
else if(x>19013){printf("19031\n");return 0;}
else if(x>19009){printf("19013\n");return 0;}
else if(x>19001){printf("19009\n");return 0;}
else if(x>18979){printf("19001\n");return 0;}
else if(x>18973){printf("18979\n");return 0;}
else if(x>18959){printf("18973\n");return 0;}
else if(x>18947){printf("18959\n");return 0;}
else if(x>18919){printf("18947\n");return 0;}
else if(x>18917){printf("18919\n");return 0;}
else if(x>18913){printf("18917\n");return 0;}
else if(x>18911){printf("18913\n");return 0;}
else if(x>18899){printf("18911\n");return 0;}
else if(x>18869){printf("18899\n");return 0;}
else if(x>18859){printf("18869\n");return 0;}
else if(x>18839){printf("18859\n");return 0;}
else if(x>18803){printf("18839\n");return 0;}
else if(x>18797){printf("18803\n");return 0;}
else if(x>18793){printf("18797\n");return 0;}
else if(x>18787){printf("18793\n");return 0;}
else if(x>18773){printf("18787\n");return 0;}
else if(x>18757){printf("18773\n");return 0;}
else if(x>18749){printf("18757\n");return 0;}
else if(x>18743){printf("18749\n");return 0;}
else if(x>18731){printf("18743\n");return 0;}
else if(x>18719){printf("18731\n");return 0;}
else if(x>18713){printf("18719\n");return 0;}
else if(x>18701){printf("18713\n");return 0;}
else if(x>18691){printf("18701\n");return 0;}
else if(x>18679){printf("18691\n");return 0;}
else if(x>18671){printf("18679\n");return 0;}
else if(x>18661){printf("18671\n");return 0;}
else if(x>18637){printf("18661\n");return 0;}
else if(x>18617){printf("18637\n");return 0;}
else if(x>18593){printf("18617\n");return 0;}
else if(x>18587){printf("18593\n");return 0;}
else if(x>18583){printf("18587\n");return 0;}
else if(x>18553){printf("18583\n");return 0;}
else if(x>18541){printf("18553\n");return 0;}
else if(x>18539){printf("18541\n");return 0;}
else if(x>18523){printf("18539\n");return 0;}
else if(x>18521){printf("18523\n");return 0;}
else if(x>18517){printf("18521\n");return 0;}
else if(x>18503){printf("18517\n");return 0;}
else if(x>18493){printf("18503\n");return 0;}
else if(x>18481){printf("18493\n");return 0;}
else if(x>18461){printf("18481\n");return 0;}
else if(x>18457){printf("18461\n");return 0;}
else if(x>18451){printf("18457\n");return 0;}
else if(x>18443){printf("18451\n");return 0;}
else if(x>18439){printf("18443\n");return 0;}
else if(x>18433){printf("18439\n");return 0;}
else if(x>18427){printf("18433\n");return 0;}
else if(x>18413){printf("18427\n");return 0;}
else if(x>18401){printf("18413\n");return 0;}
else if(x>18397){printf("18401\n");return 0;}
else if(x>18379){printf("18397\n");return 0;}
else if(x>18371){printf("18379\n");return 0;}
else if(x>18367){printf("18371\n");return 0;}
else if(x>18353){printf("18367\n");return 0;}
else if(x>18341){printf("18353\n");return 0;}
else if(x>18329){printf("18341\n");return 0;}
else if(x>18313){printf("18329\n");return 0;}
else if(x>18311){printf("18313\n");return 0;}
else if(x>18307){printf("18311\n");return 0;}
else if(x>18301){printf("18307\n");return 0;}
else if(x>18289){printf("18301\n");return 0;}
else if(x>18287){printf("18289\n");return 0;}
else if(x>18269){printf("18287\n");return 0;}
else if(x>18257){printf("18269\n");return 0;}
else if(x>18253){printf("18257\n");return 0;}
else if(x>18251){printf("18253\n");return 0;}
else if(x>18233){printf("18251\n");return 0;}
else if(x>18229){printf("18233\n");return 0;}
else if(x>18223){printf("18229\n");return 0;}
else if(x>18217){printf("18223\n");return 0;}
else if(x>18211){printf("18217\n");return 0;}
else if(x>18199){printf("18211\n");return 0;}
else if(x>18191){printf("18199\n");return 0;}
else if(x>18181){printf("18191\n");return 0;}
else if(x>18169){printf("18181\n");return 0;}
else if(x>18149){printf("18169\n");return 0;}
else if(x>18143){printf("18149\n");return 0;}
else if(x>18133){printf("18143\n");return 0;}
else if(x>18131){printf("18133\n");return 0;}
else if(x>18127){printf("18131\n");return 0;}
else if(x>18121){printf("18127\n");return 0;}
else if(x>18119){printf("18121\n");return 0;}
else if(x>18097){printf("18119\n");return 0;}
else if(x>18089){printf("18097\n");return 0;}
else if(x>18077){printf("18089\n");return 0;}
else if(x>18061){printf("18077\n");return 0;}
else if(x>18059){printf("18061\n");return 0;}
else if(x>18049){printf("18059\n");return 0;}
else if(x>18047){printf("18049\n");return 0;}
else if(x>18043){printf("18047\n");return 0;}
else if(x>18041){printf("18043\n");return 0;}
else if(x>18013){printf("18041\n");return 0;}
else if(x>17989){printf("18013\n");return 0;}
else if(x>17987){printf("17989\n");return 0;}
else if(x>17981){printf("17987\n");return 0;}
else if(x>17977){printf("17981\n");return 0;}
else if(x>17971){printf("17977\n");return 0;}
else if(x>17959){printf("17971\n");return 0;}
else if(x>17957){printf("17959\n");return 0;}
else if(x>17939){printf("17957\n");return 0;}
else if(x>17929){printf("17939\n");return 0;}
else if(x>17923){printf("17929\n");return 0;}
else if(x>17921){printf("17923\n");return 0;}
else if(x>17911){printf("17921\n");return 0;}
else if(x>17909){printf("17911\n");return 0;}
else if(x>17903){printf("17909\n");return 0;}
else if(x>17891){printf("17903\n");return 0;}
else if(x>17881){printf("17891\n");return 0;}
else if(x>17863){printf("17881\n");return 0;}
else if(x>17851){printf("17863\n");return 0;}
else if(x>17839){printf("17851\n");return 0;}
else if(x>17837){printf("17839\n");return 0;}
else if(x>17827){printf("17837\n");return 0;}
else if(x>17807){printf("17827\n");return 0;}
else if(x>17791){printf("17807\n");return 0;}
else if(x>17789){printf("17791\n");return 0;}
else if(x>17783){printf("17789\n");return 0;}
else if(x>17761){printf("17783\n");return 0;}
else if(x>17749){printf("17761\n");return 0;}
else if(x>17747){printf("17749\n");return 0;}
else if(x>17737){printf("17747\n");return 0;}
else if(x>17729){printf("17737\n");return 0;}
else if(x>17713){printf("17729\n");return 0;}
else if(x>17707){printf("17713\n");return 0;}
else if(x>17683){printf("17707\n");return 0;}
else if(x>17681){printf("17683\n");return 0;}
else if(x>17669){printf("17681\n");return 0;}
else if(x>17659){printf("17669\n");return 0;}
else if(x>17657){printf("17659\n");return 0;}
else if(x>17627){printf("17657\n");return 0;}
else if(x>17623){printf("17627\n");return 0;}
else if(x>17609){printf("17623\n");return 0;}
else if(x>17599){printf("17609\n");return 0;}
else if(x>17597){printf("17599\n");return 0;}
else if(x>17581){printf("17597\n");return 0;}
else if(x>17579){printf("17581\n");return 0;}
else if(x>17573){printf("17579\n");return 0;}
else if(x>17569){printf("17573\n");return 0;}
else if(x>17551){printf("17569\n");return 0;}
else if(x>17539){printf("17551\n");return 0;}
else if(x>17519){printf("17539\n");return 0;}
else if(x>17509){printf("17519\n");return 0;}
else if(x>17497){printf("17509\n");return 0;}
else if(x>17491){printf("17497\n");return 0;}
else if(x>17489){printf("17491\n");return 0;}
else if(x>17483){printf("17489\n");return 0;}
else if(x>17477){printf("17483\n");return 0;}
else if(x>17471){printf("17477\n");return 0;}
else if(x>17467){printf("17471\n");return 0;}
else if(x>17449){printf("17467\n");return 0;}
else if(x>17443){printf("17449\n");return 0;}
else if(x>17431){printf("17443\n");return 0;}
else if(x>17419){printf("17431\n");return 0;}
else if(x>17417){printf("17419\n");return 0;}
else if(x>17401){printf("17417\n");return 0;}
else if(x>17393){printf("17401\n");return 0;}
else if(x>17389){printf("17393\n");return 0;}
else if(x>17387){printf("17389\n");return 0;}
else if(x>17383){printf("17387\n");return 0;}
else if(x>17377){printf("17383\n");return 0;}
else if(x>17359){printf("17377\n");return 0;}
else if(x>17351){printf("17359\n");return 0;}
else if(x>17341){printf("17351\n");return 0;}
else if(x>17333){printf("17341\n");return 0;}
else if(x>17327){printf("17333\n");return 0;}
else if(x>17321){printf("17327\n");return 0;}
else if(x>17317){printf("17321\n");return 0;}
else if(x>17299){printf("17317\n");return 0;}
else if(x>17293){printf("17299\n");return 0;}
else if(x>17291){printf("17293\n");return 0;}
else if(x>17257){printf("17291\n");return 0;}
else if(x>17239){printf("17257\n");return 0;}
else if(x>17231){printf("17239\n");return 0;}
else if(x>17209){printf("17231\n");return 0;}
else if(x>17207){printf("17209\n");return 0;}
else if(x>17203){printf("17207\n");return 0;}
else if(x>17191){printf("17203\n");return 0;}
else if(x>17189){printf("17191\n");return 0;}
else if(x>17183){printf("17189\n");return 0;}
else if(x>17167){printf("17183\n");return 0;}
else if(x>17159){printf("17167\n");return 0;}
else if(x>17137){printf("17159\n");return 0;}
else if(x>17123){printf("17137\n");return 0;}
else if(x>17117){printf("17123\n");return 0;}
else if(x>17107){printf("17117\n");return 0;}
else if(x>17099){printf("17107\n");return 0;}
else if(x>17093){printf("17099\n");return 0;}
else if(x>17077){printf("17093\n");return 0;}
else if(x>17053){printf("17077\n");return 0;}
else if(x>17047){printf("17053\n");return 0;}
else if(x>17041){printf("17047\n");return 0;}
else if(x>17033){printf("17041\n");return 0;}
else if(x>17029){printf("17033\n");return 0;}
else if(x>17027){printf("17029\n");return 0;}
else if(x>17021){printf("17027\n");return 0;}
else if(x>17011){printf("17021\n");return 0;}
else if(x>16993){printf("17011\n");return 0;}
else if(x>16987){printf("16993\n");return 0;}
else if(x>16981){printf("16987\n");return 0;}
else if(x>16979){printf("16981\n");return 0;}
else if(x>16963){printf("16979\n");return 0;}
else if(x>16943){printf("16963\n");return 0;}
else if(x>16937){printf("16943\n");return 0;}
else if(x>16931){printf("16937\n");return 0;}
else if(x>16927){printf("16931\n");return 0;}
else if(x>16921){printf("16927\n");return 0;}
else if(x>16903){printf("16921\n");return 0;}
else if(x>16901){printf("16903\n");return 0;}
else if(x>16889){printf("16901\n");return 0;}
else if(x>16883){printf("16889\n");return 0;}
else if(x>16879){printf("16883\n");return 0;}
else if(x>16871){printf("16879\n");return 0;}
else if(x>16843){printf("16871\n");return 0;}
else if(x>16831){printf("16843\n");return 0;}
else if(x>16829){printf("16831\n");return 0;}
else if(x>16823){printf("16829\n");return 0;}
else if(x>16811){printf("16823\n");return 0;}
else if(x>16787){printf("16811\n");return 0;}
else if(x>16763){printf("16787\n");return 0;}
else if(x>16759){printf("16763\n");return 0;}
else if(x>16747){printf("16759\n");return 0;}
else if(x>16741){printf("16747\n");return 0;}
else if(x>16729){printf("16741\n");return 0;}
else if(x>16703){printf("16729\n");return 0;}
else if(x>16699){printf("16703\n");return 0;}
else if(x>16693){printf("16699\n");return 0;}
else if(x>16691){printf("16693\n");return 0;}
else if(x>16673){printf("16691\n");return 0;}
else if(x>16661){printf("16673\n");return 0;}
else if(x>16657){printf("16661\n");return 0;}
else if(x>16651){printf("16657\n");return 0;}
else if(x>16649){printf("16651\n");return 0;}
else if(x>16633){printf("16649\n");return 0;}
else if(x>16631){printf("16633\n");return 0;}
else if(x>16619){printf("16631\n");return 0;}
else if(x>16607){printf("16619\n");return 0;}
else if(x>16603){printf("16607\n");return 0;}
else if(x>16573){printf("16603\n");return 0;}
else if(x>16567){printf("16573\n");return 0;}
else if(x>16561){printf("16567\n");return 0;}
else if(x>16553){printf("16561\n");return 0;}
else if(x>16547){printf("16553\n");return 0;}
else if(x>16529){printf("16547\n");return 0;}
else if(x>16519){printf("16529\n");return 0;}
else if(x>16493){printf("16519\n");return 0;}
else if(x>16487){printf("16493\n");return 0;}
else if(x>16481){printf("16487\n");return 0;}
else if(x>16477){printf("16481\n");return 0;}
else if(x>16453){printf("16477\n");return 0;}
else if(x>16451){printf("16453\n");return 0;}
else if(x>16447){printf("16451\n");return 0;}
else if(x>16433){printf("16447\n");return 0;}
else if(x>16427){printf("16433\n");return 0;}
else if(x>16421){printf("16427\n");return 0;}
else if(x>16417){printf("16421\n");return 0;}
else if(x>16411){printf("16417\n");return 0;}
else if(x>16381){printf("16411\n");return 0;}
else if(x>16369){printf("16381\n");return 0;}
else if(x>16363){printf("16369\n");return 0;}
else if(x>16361){printf("16363\n");return 0;}
else if(x>16349){printf("16361\n");return 0;}
else if(x>16339){printf("16349\n");return 0;}
else if(x>16333){printf("16339\n");return 0;}
else if(x>16319){printf("16333\n");return 0;}
else if(x>16301){printf("16319\n");return 0;}
else if(x>16273){printf("16301\n");return 0;}
else if(x>16267){printf("16273\n");return 0;}
else if(x>16253){printf("16267\n");return 0;}
else if(x>16249){printf("16253\n");return 0;}
else if(x>16231){printf("16249\n");return 0;}
else if(x>16229){printf("16231\n");return 0;}
else if(x>16223){printf("16229\n");return 0;}
else if(x>16217){printf("16223\n");return 0;}
else if(x>16193){printf("16217\n");return 0;}
else if(x>16189){printf("16193\n");return 0;}
else if(x>16187){printf("16189\n");return 0;}
else if(x>16183){printf("16187\n");return 0;}
else if(x>16141){printf("16183\n");return 0;}
else if(x>16139){printf("16141\n");return 0;}
else if(x>16127){printf("16139\n");return 0;}
else if(x>16111){printf("16127\n");return 0;}
else if(x>16103){printf("16111\n");return 0;}
else if(x>16097){printf("16103\n");return 0;}
else if(x>16091){printf("16097\n");return 0;}
else if(x>16087){printf("16091\n");return 0;}
else if(x>16073){printf("16087\n");return 0;}
else if(x>16069){printf("16073\n");return 0;}
else if(x>16067){printf("16069\n");return 0;}
else if(x>16063){printf("16067\n");return 0;}
else if(x>16061){printf("16063\n");return 0;}
else if(x>16057){printf("16061\n");return 0;}
else if(x>16033){printf("16057\n");return 0;}
else if(x>16007){printf("16033\n");return 0;}
else if(x>16001){printf("16007\n");return 0;}
else if(x>15991){printf("16001\n");return 0;}
else if(x>15973){printf("15991\n");return 0;}
else if(x>15971){printf("15973\n");return 0;}
else if(x>15959){printf("15971\n");return 0;}
else if(x>15937){printf("15959\n");return 0;}
else if(x>15923){printf("15937\n");return 0;}
else if(x>15919){printf("15923\n");return 0;}
else if(x>15913){printf("15919\n");return 0;}
else if(x>15907){printf("15913\n");return 0;}
else if(x>15901){printf("15907\n");return 0;}
else if(x>15889){printf("15901\n");return 0;}
else if(x>15887){printf("15889\n");return 0;}
else if(x>15881){printf("15887\n");return 0;}
else if(x>15877){printf("15881\n");return 0;}
else if(x>15859){printf("15877\n");return 0;}
else if(x>15823){printf("15859\n");return 0;}
else if(x>15817){printf("15823\n");return 0;}
else if(x>15809){printf("15817\n");return 0;}
else if(x>15803){printf("15809\n");return 0;}
else if(x>15797){printf("15803\n");return 0;}
else if(x>15791){printf("15797\n");return 0;}
else if(x>15787){printf("15791\n");return 0;}
else if(x>15773){printf("15787\n");return 0;}
else if(x>15767){printf("15773\n");return 0;}
else if(x>15761){printf("15767\n");return 0;}
else if(x>15749){printf("15761\n");return 0;}
else if(x>15739){printf("15749\n");return 0;}
else if(x>15737){printf("15739\n");return 0;}
else if(x>15733){printf("15737\n");return 0;}
else if(x>15731){printf("15733\n");return 0;}
else if(x>15727){printf("15731\n");return 0;}
else if(x>15683){printf("15727\n");return 0;}
else if(x>15679){printf("15683\n");return 0;}
else if(x>15671){printf("15679\n");return 0;}
else if(x>15667){printf("15671\n");return 0;}
else if(x>15661){printf("15667\n");return 0;}
else if(x>15649){printf("15661\n");return 0;}
else if(x>15647){printf("15649\n");return 0;}
else if(x>15643){printf("15647\n");return 0;}
else if(x>15641){printf("15643\n");return 0;}
else if(x>15629){printf("15641\n");return 0;}
else if(x>15619){printf("15629\n");return 0;}
else if(x>15607){printf("15619\n");return 0;}
else if(x>15601){printf("15607\n");return 0;}
else if(x>15583){printf("15601\n");return 0;}
else if(x>15581){printf("15583\n");return 0;}
else if(x>15569){printf("15581\n");return 0;}
else if(x>15559){printf("15569\n");return 0;}
else if(x>15551){printf("15559\n");return 0;}
else if(x>15541){printf("15551\n");return 0;}
else if(x>15527){printf("15541\n");return 0;}
else if(x>15511){printf("15527\n");return 0;}
else if(x>15497){printf("15511\n");return 0;}
else if(x>15493){printf("15497\n");return 0;}
else if(x>15473){printf("15493\n");return 0;}
else if(x>15467){printf("15473\n");return 0;}
else if(x>15461){printf("15467\n");return 0;}
else if(x>15451){printf("15461\n");return 0;}
else if(x>15443){printf("15451\n");return 0;}
else if(x>15439){printf("15443\n");return 0;}
else if(x>15427){printf("15439\n");return 0;}
else if(x>15413){printf("15427\n");return 0;}
else if(x>15401){printf("15413\n");return 0;}
else if(x>15391){printf("15401\n");return 0;}
else if(x>15383){printf("15391\n");return 0;}
else if(x>15377){printf("15383\n");return 0;}
else if(x>15373){printf("15377\n");return 0;}
else if(x>15361){printf("15373\n");return 0;}
else if(x>15359){printf("15361\n");return 0;}
else if(x>15349){printf("15359\n");return 0;}
else if(x>15331){printf("15349\n");return 0;}
else if(x>15329){printf("15331\n");return 0;}
else if(x>15319){printf("15329\n");return 0;}
else if(x>15313){printf("15319\n");return 0;}
else if(x>15307){printf("15313\n");return 0;}
else if(x>15299){printf("15307\n");return 0;}
else if(x>15289){printf("15299\n");return 0;}
else if(x>15287){printf("15289\n");return 0;}
else if(x>15277){printf("15287\n");return 0;}
else if(x>15271){printf("15277\n");return 0;}
else if(x>15269){printf("15271\n");return 0;}
else if(x>15263){printf("15269\n");return 0;}
else if(x>15259){printf("15263\n");return 0;}
else if(x>15241){printf("15259\n");return 0;}
else if(x>15233){printf("15241\n");return 0;}
else if(x>15227){printf("15233\n");return 0;}
else if(x>15217){printf("15227\n");return 0;}
else if(x>15199){printf("15217\n");return 0;}
else if(x>15193){printf("15199\n");return 0;}
else if(x>15187){printf("15193\n");return 0;}
else if(x>15173){printf("15187\n");return 0;}
else if(x>15161){printf("15173\n");return 0;}
else if(x>15149){printf("15161\n");return 0;}
else if(x>15139){printf("15149\n");return 0;}
else if(x>15137){printf("15139\n");return 0;}
else if(x>15131){printf("15137\n");return 0;}
else if(x>15121){printf("15131\n");return 0;}
else if(x>15107){printf("15121\n");return 0;}
else if(x>15101){printf("15107\n");return 0;}
else if(x>15091){printf("15101\n");return 0;}
else if(x>15083){printf("15091\n");return 0;}
else if(x>15077){printf("15083\n");return 0;}
else if(x>15073){printf("15077\n");return 0;}
else if(x>15061){printf("15073\n");return 0;}
else if(x>15053){printf("15061\n");return 0;}
else if(x>15031){printf("15053\n");return 0;}
else if(x>15017){printf("15031\n");return 0;}
else if(x>15013){printf("15017\n");return 0;}
else if(x>14983){printf("15013\n");return 0;}
else if(x>14969){printf("14983\n");return 0;}
else if(x>14957){printf("14969\n");return 0;}
else if(x>14951){printf("14957\n");return 0;}
else if(x>14947){printf("14951\n");return 0;}
else if(x>14939){printf("14947\n");return 0;}
else if(x>14929){printf("14939\n");return 0;}
else if(x>14923){printf("14929\n");return 0;}
else if(x>14897){printf("14923\n");return 0;}
else if(x>14891){printf("14897\n");return 0;}
else if(x>14887){printf("14891\n");return 0;}
else if(x>14879){printf("14887\n");return 0;}
else if(x>14869){printf("14879\n");return 0;}
else if(x>14867){printf("14869\n");return 0;}
else if(x>14851){printf("14867\n");return 0;}
else if(x>14843){printf("14851\n");return 0;}
else if(x>14831){printf("14843\n");return 0;}
else if(x>14827){printf("14831\n");return 0;}
else if(x>14821){printf("14827\n");return 0;}
else if(x>14813){printf("14821\n");return 0;}
else if(x>14797){printf("14813\n");return 0;}
else if(x>14783){printf("14797\n");return 0;}
else if(x>14779){printf("14783\n");return 0;}
else if(x>14771){printf("14779\n");return 0;}
else if(x>14767){printf("14771\n");return 0;}
else if(x>14759){printf("14767\n");return 0;}
else if(x>14753){printf("14759\n");return 0;}
else if(x>14747){printf("14753\n");return 0;}
else if(x>14741){printf("14747\n");return 0;}
else if(x>14737){printf("14741\n");return 0;}
else if(x>14731){printf("14737\n");return 0;}
else if(x>14723){printf("14731\n");return 0;}
else if(x>14717){printf("14723\n");return 0;}
else if(x>14713){printf("14717\n");return 0;}
else if(x>14699){printf("14713\n");return 0;}
else if(x>14683){printf("14699\n");return 0;}
else if(x>14669){printf("14683\n");return 0;}
else if(x>14657){printf("14669\n");return 0;}
else if(x>14653){printf("14657\n");return 0;}
else if(x>14639){printf("14653\n");return 0;}
else if(x>14633){printf("14639\n");return 0;}
else if(x>14629){printf("14633\n");return 0;}
else if(x>14627){printf("14629\n");return 0;}
else if(x>14621){printf("14627\n");return 0;}
else if(x>14593){printf("14621\n");return 0;}
else if(x>14591){printf("14593\n");return 0;}
else if(x>14563){printf("14591\n");return 0;}
else if(x>14561){printf("14563\n");return 0;}
else if(x>14557){printf("14561\n");return 0;}
else if(x>14551){printf("14557\n");return 0;}
else if(x>14549){printf("14551\n");return 0;}
else if(x>14543){printf("14549\n");return 0;}
else if(x>14537){printf("14543\n");return 0;}
else if(x>14533){printf("14537\n");return 0;}
else if(x>14519){printf("14533\n");return 0;}
else if(x>14503){printf("14519\n");return 0;}
else if(x>14489){printf("14503\n");return 0;}
else if(x>14479){printf("14489\n");return 0;}
else if(x>14461){printf("14479\n");return 0;}
else if(x>14449){printf("14461\n");return 0;}
else if(x>14447){printf("14449\n");return 0;}
else if(x>14437){printf("14447\n");return 0;}
else if(x>14431){printf("14437\n");return 0;}
else if(x>14423){printf("14431\n");return 0;}
else if(x>14419){printf("14423\n");return 0;}
else if(x>14411){printf("14419\n");return 0;}
else if(x>14407){printf("14411\n");return 0;}
else if(x>14401){printf("14407\n");return 0;}
else if(x>14389){printf("14401\n");return 0;}
else if(x>14387){printf("14389\n");return 0;}
else if(x>14369){printf("14387\n");return 0;}
else if(x>14347){printf("14369\n");return 0;}
else if(x>14341){printf("14347\n");return 0;}
else if(x>14327){printf("14341\n");return 0;}
else if(x>14323){printf("14327\n");return 0;}
else if(x>14321){printf("14323\n");return 0;}
else if(x>14303){printf("14321\n");return 0;}
else if(x>14293){printf("14303\n");return 0;}
else if(x>14281){printf("14293\n");return 0;}
else if(x>14251){printf("14281\n");return 0;}
else if(x>14249){printf("14251\n");return 0;}
else if(x>14243){printf("14249\n");return 0;}
else if(x>14221){printf("14243\n");return 0;}
else if(x>14207){printf("14221\n");return 0;}
else if(x>14197){printf("14207\n");return 0;}
else if(x>14177){printf("14197\n");return 0;}
else if(x>14173){printf("14177\n");return 0;}
else if(x>14159){printf("14173\n");return 0;}
else if(x>14153){printf("14159\n");return 0;}
else if(x>14149){printf("14153\n");return 0;}
else if(x>14143){printf("14149\n");return 0;}
else if(x>14107){printf("14143\n");return 0;}
else if(x>14087){printf("14107\n");return 0;}
else if(x>14083){printf("14087\n");return 0;}
else if(x>14081){printf("14083\n");return 0;}
else if(x>14071){printf("14081\n");return 0;}
else if(x>14057){printf("14071\n");return 0;}
else if(x>14051){printf("14057\n");return 0;}
else if(x>14033){printf("14051\n");return 0;}
else if(x>14029){printf("14033\n");return 0;}
else if(x>14011){printf("14029\n");return 0;}
else if(x>14009){printf("14011\n");return 0;}
else if(x>13999){printf("14009\n");return 0;}
else if(x>13997){printf("13999\n");return 0;}
else if(x>13967){printf("13997\n");return 0;}
else if(x>13963){printf("13967\n");return 0;}
else if(x>13933){printf("13963\n");return 0;}
else if(x>13931){printf("13933\n");return 0;}
else if(x>13921){printf("13931\n");return 0;}
else if(x>13913){printf("13921\n");return 0;}
else if(x>13907){printf("13913\n");return 0;}
else if(x>13903){printf("13907\n");return 0;}
else if(x>13901){printf("13903\n");return 0;}
else if(x>13883){printf("13901\n");return 0;}
else if(x>13879){printf("13883\n");return 0;}
else if(x>13877){printf("13879\n");return 0;}
else if(x>13873){printf("13877\n");return 0;}
else if(x>13859){printf("13873\n");return 0;}
else if(x>13841){printf("13859\n");return 0;}
else if(x>13831){printf("13841\n");return 0;}
else if(x>13829){printf("13831\n");return 0;}
else if(x>13807){printf("13829\n");return 0;}
else if(x>13799){printf("13807\n");return 0;}
else if(x>13789){printf("13799\n");return 0;}
else if(x>13781){printf("13789\n");return 0;}
else if(x>13763){printf("13781\n");return 0;}
else if(x>13759){printf("13763\n");return 0;}
else if(x>13757){printf("13759\n");return 0;}
else if(x>13751){printf("13757\n");return 0;}
else if(x>13729){printf("13751\n");return 0;}
else if(x>13723){printf("13729\n");return 0;}
else if(x>13721){printf("13723\n");return 0;}
else if(x>13711){printf("13721\n");return 0;}
else if(x>13709){printf("13711\n");return 0;}
else if(x>13697){printf("13709\n");return 0;}
else if(x>13693){printf("13697\n");return 0;}
else if(x>13691){printf("13693\n");return 0;}
else if(x>13687){printf("13691\n");return 0;}
else if(x>13681){printf("13687\n");return 0;}
else if(x>13679){printf("13681\n");return 0;}
else if(x>13669){printf("13679\n");return 0;}
else if(x>13649){printf("13669\n");return 0;}
else if(x>13633){printf("13649\n");return 0;}
else if(x>13627){printf("13633\n");return 0;}
else if(x>13619){printf("13627\n");return 0;}
else if(x>13613){printf("13619\n");return 0;}
else if(x>13597){printf("13613\n");return 0;}
else if(x>13591){printf("13597\n");return 0;}
else if(x>13577){printf("13591\n");return 0;}
else if(x>13567){printf("13577\n");return 0;}
else if(x>13553){printf("13567\n");return 0;}
else if(x>13537){printf("13553\n");return 0;}
else if(x>13523){printf("13537\n");return 0;}
else if(x>13513){printf("13523\n");return 0;}
else if(x>13499){printf("13513\n");return 0;}
else if(x>13487){printf("13499\n");return 0;}
else if(x>13477){printf("13487\n");return 0;}
else if(x>13469){printf("13477\n");return 0;}
else if(x>13463){printf("13469\n");return 0;}
else if(x>13457){printf("13463\n");return 0;}
else if(x>13451){printf("13457\n");return 0;}
else if(x>13441){printf("13451\n");return 0;}
else if(x>13421){printf("13441\n");return 0;}
else if(x>13417){printf("13421\n");return 0;}
else if(x>13411){printf("13417\n");return 0;}
else if(x>13399){printf("13411\n");return 0;}
else if(x>13397){printf("13399\n");return 0;}
else if(x>13381){printf("13397\n");return 0;}
else if(x>13367){printf("13381\n");return 0;}
else if(x>13339){printf("13367\n");return 0;}
else if(x>13337){printf("13339\n");return 0;}
else if(x>13331){printf("13337\n");return 0;}
else if(x>13327){printf("13331\n");return 0;}
else if(x>13313){printf("13327\n");return 0;}
else if(x>13309){printf("13313\n");return 0;}
else if(x>13297){printf("13309\n");return 0;}
else if(x>13291){printf("13297\n");return 0;}
else if(x>13267){printf("13291\n");return 0;}
else if(x>13259){printf("13267\n");return 0;}
else if(x>13249){printf("13259\n");return 0;}
else if(x>13241){printf("13249\n");return 0;}
else if(x>13229){printf("13241\n");return 0;}
else if(x>13219){printf("13229\n");return 0;}
else if(x>13217){printf("13219\n");return 0;}
else if(x>13187){printf("13217\n");return 0;}
else if(x>13183){printf("13187\n");return 0;}
else if(x>13177){printf("13183\n");return 0;}
else if(x>13171){printf("13177\n");return 0;}
else if(x>13163){printf("13171\n");return 0;}
else if(x>13159){printf("13163\n");return 0;}
else if(x>13151){printf("13159\n");return 0;}
else if(x>13147){printf("13151\n");return 0;}
else if(x>13127){printf("13147\n");return 0;}
else if(x>13121){printf("13127\n");return 0;}
else if(x>13109){printf("13121\n");return 0;}
else if(x>13103){printf("13109\n");return 0;}
else if(x>13099){printf("13103\n");return 0;}
else if(x>13093){printf("13099\n");return 0;}
else if(x>13063){printf("13093\n");return 0;}
else if(x>13049){printf("13063\n");return 0;}
else if(x>13043){printf("13049\n");return 0;}
else if(x>13037){printf("13043\n");return 0;}
else if(x>13033){printf("13037\n");return 0;}
else if(x>13009){printf("13033\n");return 0;}
else if(x>13007){printf("13009\n");return 0;}
else if(x>13003){printf("13007\n");return 0;}
else if(x>13001){printf("13003\n");return 0;}
else if(x>12983){printf("13001\n");return 0;}
else if(x>12979){printf("12983\n");return 0;}
else if(x>12973){printf("12979\n");return 0;}
else if(x>12967){printf("12973\n");return 0;}
else if(x>12959){printf("12967\n");return 0;}
else if(x>12953){printf("12959\n");return 0;}
else if(x>12941){printf("12953\n");return 0;}
else if(x>12923){printf("12941\n");return 0;}
else if(x>12919){printf("12923\n");return 0;}
else if(x>12917){printf("12919\n");return 0;}
else if(x>12911){printf("12917\n");return 0;}
else if(x>12907){printf("12911\n");return 0;}
else if(x>12899){printf("12907\n");return 0;}
else if(x>12893){printf("12899\n");return 0;}
else if(x>12889){printf("12893\n");return 0;}
else if(x>12853){printf("12889\n");return 0;}
else if(x>12841){printf("12853\n");return 0;}
else if(x>12829){printf("12841\n");return 0;}
else if(x>12823){printf("12829\n");return 0;}
else if(x>12821){printf("12823\n");return 0;}
else if(x>12809){printf("12821\n");return 0;}
else if(x>12799){printf("12809\n");return 0;}
else if(x>12791){printf("12799\n");return 0;}
else if(x>12781){printf("12791\n");return 0;}
else if(x>12763){printf("12781\n");return 0;}
else if(x>12757){printf("12763\n");return 0;}
else if(x>12743){printf("12757\n");return 0;}
else if(x>12739){printf("12743\n");return 0;}
else if(x>12721){printf("12739\n");return 0;}
else if(x>12713){printf("12721\n");return 0;}
else if(x>12703){printf("12713\n");return 0;}
else if(x>12697){printf("12703\n");return 0;}
else if(x>12689){printf("12697\n");return 0;}
else if(x>12671){printf("12689\n");return 0;}
else if(x>12659){printf("12671\n");return 0;}
else if(x>12653){printf("12659\n");return 0;}
else if(x>12647){printf("12653\n");return 0;}
else if(x>12641){printf("12647\n");return 0;}
else if(x>12637){printf("12641\n");return 0;}
else if(x>12619){printf("12637\n");return 0;}
else if(x>12613){printf("12619\n");return 0;}
else if(x>12611){printf("12613\n");return 0;}
else if(x>12601){printf("12611\n");return 0;}
else if(x>12589){printf("12601\n");return 0;}
else if(x>12583){printf("12589\n");return 0;}
else if(x>12577){printf("12583\n");return 0;}
else if(x>12569){printf("12577\n");return 0;}
else if(x>12553){printf("12569\n");return 0;}
else if(x>12547){printf("12553\n");return 0;}
else if(x>12541){printf("12547\n");return 0;}
else if(x>12539){printf("12541\n");return 0;}
else if(x>12527){printf("12539\n");return 0;}
else if(x>12517){printf("12527\n");return 0;}
else if(x>12511){printf("12517\n");return 0;}
else if(x>12503){printf("12511\n");return 0;}
else if(x>12497){printf("12503\n");return 0;}
else if(x>12491){printf("12497\n");return 0;}
else if(x>12487){printf("12491\n");return 0;}
else if(x>12479){printf("12487\n");return 0;}
else if(x>12473){printf("12479\n");return 0;}
else if(x>12457){printf("12473\n");return 0;}
else if(x>12451){printf("12457\n");return 0;}
else if(x>12437){printf("12451\n");return 0;}
else if(x>12433){printf("12437\n");return 0;}
else if(x>12421){printf("12433\n");return 0;}
else if(x>12413){printf("12421\n");return 0;}
else if(x>12409){printf("12413\n");return 0;}
else if(x>12401){printf("12409\n");return 0;}
else if(x>12391){printf("12401\n");return 0;}
else if(x>12379){printf("12391\n");return 0;}
else if(x>12377){printf("12379\n");return 0;}
else if(x>12373){printf("12377\n");return 0;}
else if(x>12347){printf("12373\n");return 0;}
else if(x>12343){printf("12347\n");return 0;}
else if(x>12329){printf("12343\n");return 0;}
else if(x>12323){printf("12329\n");return 0;}
else if(x>12301){printf("12323\n");return 0;}
else if(x>12289){printf("12301\n");return 0;}
else if(x>12281){printf("12289\n");return 0;}
else if(x>12277){printf("12281\n");return 0;}
else if(x>12269){printf("12277\n");return 0;}
else if(x>12263){printf("12269\n");return 0;}
else if(x>12253){printf("12263\n");return 0;}
else if(x>12251){printf("12253\n");return 0;}
else if(x>12241){printf("12251\n");return 0;}
else if(x>12239){printf("12241\n");return 0;}
else if(x>12227){printf("12239\n");return 0;}
else if(x>12211){printf("12227\n");return 0;}
else if(x>12203){printf("12211\n");return 0;}
else if(x>12197){printf("12203\n");return 0;}
else if(x>12163){printf("12197\n");return 0;}
else if(x>12161){printf("12163\n");return 0;}
else if(x>12157){printf("12161\n");return 0;}
else if(x>12149){printf("12157\n");return 0;}
else if(x>12143){printf("12149\n");return 0;}
else if(x>12119){printf("12143\n");return 0;}
else if(x>12113){printf("12119\n");return 0;}
else if(x>12109){printf("12113\n");return 0;}
else if(x>12107){printf("12109\n");return 0;}
else if(x>12101){printf("12107\n");return 0;}
else if(x>12097){printf("12101\n");return 0;}
else if(x>12073){printf("12097\n");return 0;}
else if(x>12071){printf("12073\n");return 0;}
else if(x>12049){printf("12071\n");return 0;}
else if(x>12043){printf("12049\n");return 0;}
else if(x>12041){printf("12043\n");return 0;}
else if(x>12037){printf("12041\n");return 0;}
else if(x>12011){printf("12037\n");return 0;}
else if(x>12007){printf("12011\n");return 0;}
else if(x>11987){printf("12007\n");return 0;}
else if(x>11981){printf("11987\n");return 0;}
else if(x>11971){printf("11981\n");return 0;}
else if(x>11969){printf("11971\n");return 0;}
else if(x>11959){printf("11969\n");return 0;}
else if(x>11953){printf("11959\n");return 0;}
else if(x>11941){printf("11953\n");return 0;}
else if(x>11939){printf("11941\n");return 0;}
else if(x>11933){printf("11939\n");return 0;}
else if(x>11927){printf("11933\n");return 0;}
else if(x>11923){printf("11927\n");return 0;}
else if(x>11909){printf("11923\n");return 0;}
else if(x>11903){printf("11909\n");return 0;}
else if(x>11897){printf("11903\n");return 0;}
else if(x>11887){printf("11897\n");return 0;}
else if(x>11867){printf("11887\n");return 0;}
else if(x>11863){printf("11867\n");return 0;}
else if(x>11839){printf("11863\n");return 0;}
else if(x>11833){printf("11839\n");return 0;}
else if(x>11831){printf("11833\n");return 0;}
else if(x>11827){printf("11831\n");return 0;}
else if(x>11821){printf("11827\n");return 0;}
else if(x>11813){printf("11821\n");return 0;}
else if(x>11807){printf("11813\n");return 0;}
else if(x>11801){printf("11807\n");return 0;}
else if(x>11789){printf("11801\n");return 0;}
else if(x>11783){printf("11789\n");return 0;}
else if(x>11779){printf("11783\n");return 0;}
else if(x>11777){printf("11779\n");return 0;}
else if(x>11743){printf("11777\n");return 0;}
else if(x>11731){printf("11743\n");return 0;}
else if(x>11719){printf("11731\n");return 0;}
else if(x>11717){printf("11719\n");return 0;}
else if(x>11701){printf("11717\n");return 0;}
else if(x>11699){printf("11701\n");return 0;}
else if(x>11689){printf("11699\n");return 0;}
else if(x>11681){printf("11689\n");return 0;}
else if(x>11677){printf("11681\n");return 0;}
else if(x>11657){printf("11677\n");return 0;}
else if(x>11633){printf("11657\n");return 0;}
else if(x>11621){printf("11633\n");return 0;}
else if(x>11617){printf("11621\n");return 0;}
else if(x>11597){printf("11617\n");return 0;}
else if(x>11593){printf("11597\n");return 0;}
else if(x>11587){printf("11593\n");return 0;}
else if(x>11579){printf("11587\n");return 0;}
else if(x>11551){printf("11579\n");return 0;}
else if(x>11549){printf("11551\n");return 0;}
else if(x>11527){printf("11549\n");return 0;}
else if(x>11519){printf("11527\n");return 0;}
else if(x>11503){printf("11519\n");return 0;}
else if(x>11497){printf("11503\n");return 0;}
else if(x>11491){printf("11497\n");return 0;}
else if(x>11489){printf("11491\n");return 0;}
else if(x>11483){printf("11489\n");return 0;}
else if(x>11471){printf("11483\n");return 0;}
else if(x>11467){printf("11471\n");return 0;}
else if(x>11447){printf("11467\n");return 0;}
else if(x>11443){printf("11447\n");return 0;}
else if(x>11437){printf("11443\n");return 0;}
else if(x>11423){printf("11437\n");return 0;}
else if(x>11411){printf("11423\n");return 0;}
else if(x>11399){printf("11411\n");return 0;}
else if(x>11393){printf("11399\n");return 0;}
else if(x>11383){printf("11393\n");return 0;}
else if(x>11369){printf("11383\n");return 0;}
else if(x>11353){printf("11369\n");return 0;}
else if(x>11351){printf("11353\n");return 0;}
else if(x>11329){printf("11351\n");return 0;}
else if(x>11321){printf("11329\n");return 0;}
else if(x>11317){printf("11321\n");return 0;}
else if(x>11311){printf("11317\n");return 0;}
else if(x>11299){printf("11311\n");return 0;}
else if(x>11287){printf("11299\n");return 0;}
else if(x>11279){printf("11287\n");return 0;}
else if(x>11273){printf("11279\n");return 0;}
else if(x>11261){printf("11273\n");return 0;}
else if(x>11257){printf("11261\n");return 0;}
else if(x>11251){printf("11257\n");return 0;}
else if(x>11243){printf("11251\n");return 0;}
else if(x>11239){printf("11243\n");return 0;}
else if(x>11213){printf("11239\n");return 0;}
else if(x>11197){printf("11213\n");return 0;}
else if(x>11177){printf("11197\n");return 0;}
else if(x>11173){printf("11177\n");return 0;}
else if(x>11171){printf("11173\n");return 0;}
else if(x>11161){printf("11171\n");return 0;}
else if(x>11159){printf("11161\n");return 0;}
else if(x>11149){printf("11159\n");return 0;}
else if(x>11131){printf("11149\n");return 0;}
else if(x>11119){printf("11131\n");return 0;}
else if(x>11117){printf("11119\n");return 0;}
else if(x>11113){printf("11117\n");return 0;}
else if(x>11093){printf("11113\n");return 0;}
else if(x>11087){printf("11093\n");return 0;}
else if(x>11083){printf("11087\n");return 0;}
else if(x>11071){printf("11083\n");return 0;}
else if(x>11069){printf("11071\n");return 0;}
else if(x>11059){printf("11069\n");return 0;}
else if(x>11057){printf("11059\n");return 0;}
else if(x>11047){printf("11057\n");return 0;}
else if(x>11027){printf("11047\n");return 0;}
else if(x>11003){printf("11027\n");return 0;}
else if(x>10993){printf("11003\n");return 0;}
else if(x>10987){printf("10993\n");return 0;}
else if(x>10979){printf("10987\n");return 0;}
else if(x>10973){printf("10979\n");return 0;}
else if(x>10957){printf("10973\n");return 0;}
else if(x>10949){printf("10957\n");return 0;}
else if(x>10939){printf("10949\n");return 0;}
else if(x>10937){printf("10939\n");return 0;}
else if(x>10909){printf("10937\n");return 0;}
else if(x>10903){printf("10909\n");return 0;}
else if(x>10891){printf("10903\n");return 0;}
else if(x>10889){printf("10891\n");return 0;}
else if(x>10883){printf("10889\n");return 0;}
else if(x>10867){printf("10883\n");return 0;}
else if(x>10861){printf("10867\n");return 0;}
else if(x>10859){printf("10861\n");return 0;}
else if(x>10853){printf("10859\n");return 0;}
else if(x>10847){printf("10853\n");return 0;}
else if(x>10837){printf("10847\n");return 0;}
else if(x>10831){printf("10837\n");return 0;}
else if(x>10799){printf("10831\n");return 0;}
else if(x>10789){printf("10799\n");return 0;}
else if(x>10781){printf("10789\n");return 0;}
else if(x>10771){printf("10781\n");return 0;}
else if(x>10753){printf("10771\n");return 0;}
else if(x>10739){printf("10753\n");return 0;}
else if(x>10733){printf("10739\n");return 0;}
else if(x>10729){printf("10733\n");return 0;}
else if(x>10723){printf("10729\n");return 0;}
else if(x>10711){printf("10723\n");return 0;}
else if(x>10709){printf("10711\n");return 0;}
else if(x>10691){printf("10709\n");return 0;}
else if(x>10687){printf("10691\n");return 0;}
else if(x>10667){printf("10687\n");return 0;}
else if(x>10663){printf("10667\n");return 0;}
else if(x>10657){printf("10663\n");return 0;}
else if(x>10651){printf("10657\n");return 0;}
else if(x>10639){printf("10651\n");return 0;}
else if(x>10631){printf("10639\n");return 0;}
else if(x>10627){printf("10631\n");return 0;}
else if(x>10613){printf("10627\n");return 0;}
else if(x>10607){printf("10613\n");return 0;}
else if(x>10601){printf("10607\n");return 0;}
else if(x>10597){printf("10601\n");return 0;}
else if(x>10589){printf("10597\n");return 0;}
else if(x>10567){printf("10589\n");return 0;}
else if(x>10559){printf("10567\n");return 0;}
else if(x>10531){printf("10559\n");return 0;}
else if(x>10529){printf("10531\n");return 0;}
else if(x>10513){printf("10529\n");return 0;}
else if(x>10501){printf("10513\n");return 0;}
else if(x>10499){printf("10501\n");return 0;}
else if(x>10487){printf("10499\n");return 0;}
else if(x>10477){printf("10487\n");return 0;}
else if(x>10463){printf("10477\n");return 0;}
else if(x>10459){printf("10463\n");return 0;}
else if(x>10457){printf("10459\n");return 0;}
else if(x>10453){printf("10457\n");return 0;}
else if(x>10433){printf("10453\n");return 0;}
else if(x>10429){printf("10433\n");return 0;}
else if(x>10427){printf("10429\n");return 0;}
else if(x>10399){printf("10427\n");return 0;}
else if(x>10391){printf("10399\n");return 0;}
else if(x>10369){printf("10391\n");return 0;}
else if(x>10357){printf("10369\n");return 0;}
else if(x>10343){printf("10357\n");return 0;}
else if(x>10337){printf("10343\n");return 0;}
else if(x>10333){printf("10337\n");return 0;}
else if(x>10331){printf("10333\n");return 0;}
else if(x>10321){printf("10331\n");return 0;}
else if(x>10313){printf("10321\n");return 0;}
else if(x>10303){printf("10313\n");return 0;}
else if(x>10301){printf("10303\n");return 0;}
else if(x>10289){printf("10301\n");return 0;}
else if(x>10273){printf("10289\n");return 0;}
else if(x>10271){printf("10273\n");return 0;}
else if(x>10267){printf("10271\n");return 0;}
else if(x>10259){printf("10267\n");return 0;}
else if(x>10253){printf("10259\n");return 0;}
else if(x>10247){printf("10253\n");return 0;}
else if(x>10243){printf("10247\n");return 0;}
else if(x>10223){printf("10243\n");return 0;}
else if(x>10211){printf("10223\n");return 0;}
else if(x>10193){printf("10211\n");return 0;}
else if(x>10181){printf("10193\n");return 0;}
else if(x>10177){printf("10181\n");return 0;}
else if(x>10169){printf("10177\n");return 0;}
else if(x>10163){printf("10169\n");return 0;}
else if(x>10159){printf("10163\n");return 0;}
else if(x>10151){printf("10159\n");return 0;}
else if(x>10141){printf("10151\n");return 0;}
else if(x>10139){printf("10141\n");return 0;}
else if(x>10133){printf("10139\n");return 0;}
else if(x>10111){printf("10133\n");return 0;}
else if(x>10103){printf("10111\n");return 0;}
else if(x>10099){printf("10103\n");return 0;}
else if(x>10093){printf("10099\n");return 0;}
else if(x>10091){printf("10093\n");return 0;}
else if(x>10079){printf("10091\n");return 0;}
else if(x>10069){printf("10079\n");return 0;}
else if(x>10067){printf("10069\n");return 0;}
else if(x>10061){printf("10067\n");return 0;}
else if(x>10039){printf("10061\n");return 0;}
else if(x>10037){printf("10039\n");return 0;}
else if(x>10009){printf("10037\n");return 0;}
else if(x>10007){printf("10009\n");return 0;}
else if(x>9973){printf("10007\n");return 0;}
else if(x>9967){printf("9973\n");return 0;}
else if(x>9949){printf("9967\n");return 0;}
else if(x>9941){printf("9949\n");return 0;}
else if(x>9931){printf("9941\n");return 0;}
else if(x>9929){printf("9931\n");return 0;}
else if(x>9923){printf("9929\n");return 0;}
else if(x>9907){printf("9923\n");return 0;}
else if(x>9901){printf("9907\n");return 0;}
else if(x>9887){printf("9901\n");return 0;}
else if(x>9883){printf("9887\n");return 0;}
else if(x>9871){printf("9883\n");return 0;}
else if(x>9859){printf("9871\n");return 0;}
else if(x>9857){printf("9859\n");return 0;}
else if(x>9851){printf("9857\n");return 0;}
else if(x>9839){printf("9851\n");return 0;}
else if(x>9833){printf("9839\n");return 0;}
else if(x>9829){printf("9833\n");return 0;}
else if(x>9817){printf("9829\n");return 0;}
else if(x>9811){printf("9817\n");return 0;}
else if(x>9803){printf("9811\n");return 0;}
else if(x>9791){printf("9803\n");return 0;}
else if(x>9787){printf("9791\n");return 0;}
else if(x>9781){printf("9787\n");return 0;}
else if(x>9769){printf("9781\n");return 0;}
else if(x>9767){printf("9769\n");return 0;}
else if(x>9749){printf("9767\n");return 0;}
else if(x>9743){printf("9749\n");return 0;}
else if(x>9739){printf("9743\n");return 0;}
else if(x>9733){printf("9739\n");return 0;}
else if(x>9721){printf("9733\n");return 0;}
else if(x>9719){printf("9721\n");return 0;}
else if(x>9697){printf("9719\n");return 0;}
else if(x>9689){printf("9697\n");return 0;}
else if(x>9679){printf("9689\n");return 0;}
else if(x>9677){printf("9679\n");return 0;}
else if(x>9661){printf("9677\n");return 0;}
else if(x>9649){printf("9661\n");return 0;}
else if(x>9643){printf("9649\n");return 0;}
else if(x>9631){printf("9643\n");return 0;}
else if(x>9629){printf("9631\n");return 0;}
else if(x>9623){printf("9629\n");return 0;}
else if(x>9619){printf("9623\n");return 0;}
else if(x>9613){printf("9619\n");return 0;}
else if(x>9601){printf("9613\n");return 0;}
else if(x>9587){printf("9601\n");return 0;}
else if(x>9551){printf("9587\n");return 0;}
else if(x>9547){printf("9551\n");return 0;}
else if(x>9539){printf("9547\n");return 0;}
else if(x>9533){printf("9539\n");return 0;}
else if(x>9521){printf("9533\n");return 0;}
else if(x>9511){printf("9521\n");return 0;}
else if(x>9497){printf("9511\n");return 0;}
else if(x>9491){printf("9497\n");return 0;}
else if(x>9479){printf("9491\n");return 0;}
else if(x>9473){printf("9479\n");return 0;}
else if(x>9467){printf("9473\n");return 0;}
else if(x>9463){printf("9467\n");return 0;}
else if(x>9461){printf("9463\n");return 0;}
else if(x>9439){printf("9461\n");return 0;}
else if(x>9437){printf("9439\n");return 0;}
else if(x>9433){printf("9437\n");return 0;}
else if(x>9431){printf("9433\n");return 0;}
else if(x>9421){printf("9431\n");return 0;}
else if(x>9419){printf("9421\n");return 0;}
else if(x>9413){printf("9419\n");return 0;}
else if(x>9403){printf("9413\n");return 0;}
else if(x>9397){printf("9403\n");return 0;}
else if(x>9391){printf("9397\n");return 0;}
else if(x>9377){printf("9391\n");return 0;}
else if(x>9371){printf("9377\n");return 0;}
else if(x>9349){printf("9371\n");return 0;}
else if(x>9343){printf("9349\n");return 0;}
else if(x>9341){printf("9343\n");return 0;}
else if(x>9337){printf("9341\n");return 0;}
else if(x>9323){printf("9337\n");return 0;}
else if(x>9319){printf("9323\n");return 0;}
else if(x>9311){printf("9319\n");return 0;}
else if(x>9293){printf("9311\n");return 0;}
else if(x>9283){printf("9293\n");return 0;}
else if(x>9281){printf("9283\n");return 0;}
else if(x>9277){printf("9281\n");return 0;}
else if(x>9257){printf("9277\n");return 0;}
else if(x>9241){printf("9257\n");return 0;}
else if(x>9239){printf("9241\n");return 0;}
else if(x>9227){printf("9239\n");return 0;}
else if(x>9221){printf("9227\n");return 0;}
else if(x>9209){printf("9221\n");return 0;}
else if(x>9203){printf("9209\n");return 0;}
else if(x>9199){printf("9203\n");return 0;}
else if(x>9187){printf("9199\n");return 0;}
else if(x>9181){printf("9187\n");return 0;}
else if(x>9173){printf("9181\n");return 0;}
else if(x>9161){printf("9173\n");return 0;}
else if(x>9157){printf("9161\n");return 0;}
else if(x>9151){printf("9157\n");return 0;}
else if(x>9137){printf("9151\n");return 0;}
else if(x>9133){printf("9137\n");return 0;}
else if(x>9127){printf("9133\n");return 0;}
else if(x>9109){printf("9127\n");return 0;}
else if(x>9103){printf("9109\n");return 0;}
else if(x>9091){printf("9103\n");return 0;}
else if(x>9067){printf("9091\n");return 0;}
else if(x>9059){printf("9067\n");return 0;}
else if(x>9049){printf("9059\n");return 0;}
else if(x>9043){printf("9049\n");return 0;}
else if(x>9041){printf("9043\n");return 0;}
else if(x>9029){printf("9041\n");return 0;}
else if(x>9013){printf("9029\n");return 0;}
else if(x>9011){printf("9013\n");return 0;}
else if(x>9007){printf("9011\n");return 0;}
else if(x>9001){printf("9007\n");return 0;}
else if(x>8999){printf("9001\n");return 0;}
else if(x>8971){printf("8999\n");return 0;}
else if(x>8969){printf("8971\n");return 0;}
else if(x>8963){printf("8969\n");return 0;}
else if(x>8951){printf("8963\n");return 0;}
else if(x>8941){printf("8951\n");return 0;}
else if(x>8933){printf("8941\n");return 0;}
else if(x>8929){printf("8933\n");return 0;}
else if(x>8923){printf("8929\n");return 0;}
else if(x>8893){printf("8923\n");return 0;}
else if(x>8887){printf("8893\n");return 0;}
else if(x>8867){printf("8887\n");return 0;}
else if(x>8863){printf("8867\n");return 0;}
else if(x>8861){printf("8863\n");return 0;}
else if(x>8849){printf("8861\n");return 0;}
else if(x>8839){printf("8849\n");return 0;}
else if(x>8837){printf("8839\n");return 0;}
else if(x>8831){printf("8837\n");return 0;}
else if(x>8821){printf("8831\n");return 0;}
else if(x>8819){printf("8821\n");return 0;}
else if(x>8807){printf("8819\n");return 0;}
else if(x>8803){printf("8807\n");return 0;}
else if(x>8783){printf("8803\n");return 0;}
else if(x>8779){printf("8783\n");return 0;}
else if(x>8761){printf("8779\n");return 0;}
else if(x>8753){printf("8761\n");return 0;}
else if(x>8747){printf("8753\n");return 0;}
else if(x>8741){printf("8747\n");return 0;}
else if(x>8737){printf("8741\n");return 0;}
else if(x>8731){printf("8737\n");return 0;}
else if(x>8719){printf("8731\n");return 0;}
else if(x>8713){printf("8719\n");return 0;}
else if(x>8707){printf("8713\n");return 0;}
else if(x>8699){printf("8707\n");return 0;}
else if(x>8693){printf("8699\n");return 0;}
else if(x>8689){printf("8693\n");return 0;}
else if(x>8681){printf("8689\n");return 0;}
else if(x>8677){printf("8681\n");return 0;}
else if(x>8669){printf("8677\n");return 0;}
else if(x>8663){printf("8669\n");return 0;}
else if(x>8647){printf("8663\n");return 0;}
else if(x>8641){printf("8647\n");return 0;}
else if(x>8629){printf("8641\n");return 0;}
else if(x>8627){printf("8629\n");return 0;}
else if(x>8623){printf("8627\n");return 0;}
else if(x>8609){printf("8623\n");return 0;}
else if(x>8599){printf("8609\n");return 0;}
else if(x>8597){printf("8599\n");return 0;}
else if(x>8581){printf("8597\n");return 0;}
else if(x>8573){printf("8581\n");return 0;}
else if(x>8563){printf("8573\n");return 0;}
else if(x>8543){printf("8563\n");return 0;}
else if(x>8539){printf("8543\n");return 0;}
else if(x>8537){printf("8539\n");return 0;}
else if(x>8527){printf("8537\n");return 0;}
else if(x>8521){printf("8527\n");return 0;}
else if(x>8513){printf("8521\n");return 0;}
else if(x>8501){printf("8513\n");return 0;}
else if(x>8467){printf("8501\n");return 0;}
else if(x>8461){printf("8467\n");return 0;}
else if(x>8447){printf("8461\n");return 0;}
else if(x>8443){printf("8447\n");return 0;}
else if(x>8431){printf("8443\n");return 0;}
else if(x>8429){printf("8431\n");return 0;}
else if(x>8423){printf("8429\n");return 0;}
else if(x>8419){printf("8423\n");return 0;}
else if(x>8389){printf("8419\n");return 0;}
else if(x>8387){printf("8389\n");return 0;}
else if(x>8377){printf("8387\n");return 0;}
else if(x>8369){printf("8377\n");return 0;}
else if(x>8363){printf("8369\n");return 0;}
else if(x>8353){printf("8363\n");return 0;}
else if(x>8329){printf("8353\n");return 0;}
else if(x>8317){printf("8329\n");return 0;}
else if(x>8311){printf("8317\n");return 0;}
else if(x>8297){printf("8311\n");return 0;}
else if(x>8293){printf("8297\n");return 0;}
else if(x>8291){printf("8293\n");return 0;}
else if(x>8287){printf("8291\n");return 0;}
else if(x>8273){printf("8287\n");return 0;}
else if(x>8269){printf("8273\n");return 0;}
else if(x>8263){printf("8269\n");return 0;}
else if(x>8243){printf("8263\n");return 0;}
else if(x>8237){printf("8243\n");return 0;}
else if(x>8233){printf("8237\n");return 0;}
else if(x>8231){printf("8233\n");return 0;}
else if(x>8221){printf("8231\n");return 0;}
else if(x>8219){printf("8221\n");return 0;}
else if(x>8209){printf("8219\n");return 0;}
else if(x>8191){printf("8209\n");return 0;}
else if(x>8179){printf("8191\n");return 0;}
else if(x>8171){printf("8179\n");return 0;}
else if(x>8167){printf("8171\n");return 0;}
else if(x>8161){printf("8167\n");return 0;}
else if(x>8147){printf("8161\n");return 0;}
else if(x>8123){printf("8147\n");return 0;}
else if(x>8117){printf("8123\n");return 0;}
else if(x>8111){printf("8117\n");return 0;}
else if(x>8101){printf("8111\n");return 0;}
else if(x>8093){printf("8101\n");return 0;}
else if(x>8089){printf("8093\n");return 0;}
else if(x>8087){printf("8089\n");return 0;}
else if(x>8081){printf("8087\n");return 0;}
else if(x>8069){printf("8081\n");return 0;}
else if(x>8059){printf("8069\n");return 0;}
else if(x>8053){printf("8059\n");return 0;}
else if(x>8039){printf("8053\n");return 0;}
else if(x>8017){printf("8039\n");return 0;}
else if(x>8011){printf("8017\n");return 0;}
else if(x>8009){printf("8011\n");return 0;}
else if(x>7993){printf("8009\n");return 0;}
else if(x>7963){printf("7993\n");return 0;}
else if(x>7951){printf("7963\n");return 0;}
else if(x>7949){printf("7951\n");return 0;}
else if(x>7937){printf("7949\n");return 0;}
else if(x>7933){printf("7937\n");return 0;}
else if(x>7927){printf("7933\n");return 0;}
else if(x>7919){printf("7927\n");return 0;}
else if(x>7907){printf("7919\n");return 0;}
else if(x>7901){printf("7907\n");return 0;}
else if(x>7883){printf("7901\n");return 0;}
else if(x>7879){printf("7883\n");return 0;}
else if(x>7877){printf("7879\n");return 0;}
else if(x>7873){printf("7877\n");return 0;}
else if(x>7867){printf("7873\n");return 0;}
else if(x>7853){printf("7867\n");return 0;}
else if(x>7841){printf("7853\n");return 0;}
else if(x>7829){printf("7841\n");return 0;}
else if(x>7823){printf("7829\n");return 0;}
else if(x>7817){printf("7823\n");return 0;}
else if(x>7793){printf("7817\n");return 0;}
else if(x>7789){printf("7793\n");return 0;}
else if(x>7759){printf("7789\n");return 0;}
else if(x>7757){printf("7759\n");return 0;}
else if(x>7753){printf("7757\n");return 0;}
else if(x>7741){printf("7753\n");return 0;}
else if(x>7727){printf("7741\n");return 0;}
else if(x>7723){printf("7727\n");return 0;}
else if(x>7717){printf("7723\n");return 0;}
else if(x>7703){printf("7717\n");return 0;}
else if(x>7699){printf("7703\n");return 0;}
else if(x>7691){printf("7699\n");return 0;}
else if(x>7687){printf("7691\n");return 0;}
else if(x>7681){printf("7687\n");return 0;}
else if(x>7673){printf("7681\n");return 0;}
else if(x>7669){printf("7673\n");return 0;}
else if(x>7649){printf("7669\n");return 0;}
else if(x>7643){printf("7649\n");return 0;}
else if(x>7639){printf("7643\n");return 0;}
else if(x>7621){printf("7639\n");return 0;}
else if(x>7607){printf("7621\n");return 0;}
else if(x>7603){printf("7607\n");return 0;}
else if(x>7591){printf("7603\n");return 0;}
else if(x>7589){printf("7591\n");return 0;}
else if(x>7583){printf("7589\n");return 0;}
else if(x>7577){printf("7583\n");return 0;}
else if(x>7573){printf("7577\n");return 0;}
else if(x>7561){printf("7573\n");return 0;}
else if(x>7559){printf("7561\n");return 0;}
else if(x>7549){printf("7559\n");return 0;}
else if(x>7547){printf("7549\n");return 0;}
else if(x>7541){printf("7547\n");return 0;}
else if(x>7537){printf("7541\n");return 0;}
else if(x>7529){printf("7537\n");return 0;}
else if(x>7523){printf("7529\n");return 0;}
else if(x>7517){printf("7523\n");return 0;}
else if(x>7507){printf("7517\n");return 0;}
else if(x>7499){printf("7507\n");return 0;}
else if(x>7489){printf("7499\n");return 0;}
else if(x>7487){printf("7489\n");return 0;}
else if(x>7481){printf("7487\n");return 0;}
else if(x>7477){printf("7481\n");return 0;}
else if(x>7459){printf("7477\n");return 0;}
else if(x>7457){printf("7459\n");return 0;}
else if(x>7451){printf("7457\n");return 0;}
else if(x>7433){printf("7451\n");return 0;}
else if(x>7417){printf("7433\n");return 0;}
else if(x>7411){printf("7417\n");return 0;}
else if(x>7393){printf("7411\n");return 0;}
else if(x>7369){printf("7393\n");return 0;}
else if(x>7351){printf("7369\n");return 0;}
else if(x>7349){printf("7351\n");return 0;}
else if(x>7333){printf("7349\n");return 0;}
else if(x>7331){printf("7333\n");return 0;}
else if(x>7321){printf("7331\n");return 0;}
else if(x>7309){printf("7321\n");return 0;}
else if(x>7307){printf("7309\n");return 0;}
else if(x>7297){printf("7307\n");return 0;}
else if(x>7283){printf("7297\n");return 0;}
else if(x>7253){printf("7283\n");return 0;}
else if(x>7247){printf("7253\n");return 0;}
else if(x>7243){printf("7247\n");return 0;}
else if(x>7237){printf("7243\n");return 0;}
else if(x>7229){printf("7237\n");return 0;}
else if(x>7219){printf("7229\n");return 0;}
else if(x>7213){printf("7219\n");return 0;}
else if(x>7211){printf("7213\n");return 0;}
else if(x>7207){printf("7211\n");return 0;}
else if(x>7193){printf("7207\n");return 0;}
else if(x>7187){printf("7193\n");return 0;}
else if(x>7177){printf("7187\n");return 0;}
else if(x>7159){printf("7177\n");return 0;}
else if(x>7151){printf("7159\n");return 0;}
else if(x>7129){printf("7151\n");return 0;}
else if(x>7127){printf("7129\n");return 0;}
else if(x>7121){printf("7127\n");return 0;}
else if(x>7109){printf("7121\n");return 0;}
else if(x>7103){printf("7109\n");return 0;}
else if(x>7079){printf("7103\n");return 0;}
else if(x>7069){printf("7079\n");return 0;}
else if(x>7057){printf("7069\n");return 0;}
else if(x>7043){printf("7057\n");return 0;}
else if(x>7039){printf("7043\n");return 0;}
else if(x>7027){printf("7039\n");return 0;}
else if(x>7019){printf("7027\n");return 0;}
else if(x>7013){printf("7019\n");return 0;}
else if(x>7001){printf("7013\n");return 0;}
else if(x>6997){printf("7001\n");return 0;}
else if(x>6991){printf("6997\n");return 0;}
else if(x>6983){printf("6991\n");return 0;}
else if(x>6977){printf("6983\n");return 0;}
else if(x>6971){printf("6977\n");return 0;}
else if(x>6967){printf("6971\n");return 0;}
else if(x>6961){printf("6967\n");return 0;}
else if(x>6959){printf("6961\n");return 0;}
else if(x>6949){printf("6959\n");return 0;}
else if(x>6947){printf("6949\n");return 0;}
else if(x>6917){printf("6947\n");return 0;}
else if(x>6911){printf("6917\n");return 0;}
else if(x>6907){printf("6911\n");return 0;}
else if(x>6899){printf("6907\n");return 0;}
else if(x>6883){printf("6899\n");return 0;}
else if(x>6871){printf("6883\n");return 0;}
else if(x>6869){printf("6871\n");return 0;}
else if(x>6863){printf("6869\n");return 0;}
else if(x>6857){printf("6863\n");return 0;}
else if(x>6841){printf("6857\n");return 0;}
else if(x>6833){printf("6841\n");return 0;}
else if(x>6829){printf("6833\n");return 0;}
else if(x>6827){printf("6829\n");return 0;}
else if(x>6823){printf("6827\n");return 0;}
else if(x>6803){printf("6823\n");return 0;}
else if(x>6793){printf("6803\n");return 0;}
else if(x>6791){printf("6793\n");return 0;}
else if(x>6781){printf("6791\n");return 0;}
else if(x>6779){printf("6781\n");return 0;}
else if(x>6763){printf("6779\n");return 0;}
else if(x>6761){printf("6763\n");return 0;}
else if(x>6737){printf("6761\n");return 0;}
else if(x>6733){printf("6737\n");return 0;}
else if(x>6719){printf("6733\n");return 0;}
else if(x>6709){printf("6719\n");return 0;}
else if(x>6703){printf("6709\n");return 0;}
else if(x>6701){printf("6703\n");return 0;}
else if(x>6691){printf("6701\n");return 0;}
else if(x>6689){printf("6691\n");return 0;}
else if(x>6679){printf("6689\n");return 0;}
else if(x>6673){printf("6679\n");return 0;}
else if(x>6661){printf("6673\n");return 0;}
else if(x>6659){printf("6661\n");return 0;}
else if(x>6653){printf("6659\n");return 0;}
else if(x>6637){printf("6653\n");return 0;}
else if(x>6619){printf("6637\n");return 0;}
else if(x>6607){printf("6619\n");return 0;}
else if(x>6599){printf("6607\n");return 0;}
else if(x>6581){printf("6599\n");return 0;}
else if(x>6577){printf("6581\n");return 0;}
else if(x>6571){printf("6577\n");return 0;}
else if(x>6569){printf("6571\n");return 0;}
else if(x>6563){printf("6569\n");return 0;}
else if(x>6553){printf("6563\n");return 0;}
else if(x>6551){printf("6553\n");return 0;}
else if(x>6547){printf("6551\n");return 0;}
else if(x>6529){printf("6547\n");return 0;}
else if(x>6521){printf("6529\n");return 0;}
else if(x>6491){printf("6521\n");return 0;}
else if(x>6481){printf("6491\n");return 0;}
else if(x>6473){printf("6481\n");return 0;}
else if(x>6469){printf("6473\n");return 0;}
else if(x>6451){printf("6469\n");return 0;}
else if(x>6449){printf("6451\n");return 0;}
else if(x>6427){printf("6449\n");return 0;}
else if(x>6421){printf("6427\n");return 0;}
else if(x>6397){printf("6421\n");return 0;}
else if(x>6389){printf("6397\n");return 0;}
else if(x>6379){printf("6389\n");return 0;}
else if(x>6373){printf("6379\n");return 0;}
else if(x>6367){printf("6373\n");return 0;}
else if(x>6361){printf("6367\n");return 0;}
else if(x>6359){printf("6361\n");return 0;}
else if(x>6353){printf("6359\n");return 0;}
else if(x>6343){printf("6353\n");return 0;}
else if(x>6337){printf("6343\n");return 0;}
else if(x>6329){printf("6337\n");return 0;}
else if(x>6323){printf("6329\n");return 0;}
else if(x>6317){printf("6323\n");return 0;}
else if(x>6311){printf("6317\n");return 0;}
else if(x>6301){printf("6311\n");return 0;}
else if(x>6299){printf("6301\n");return 0;}
else if(x>6287){printf("6299\n");return 0;}
else if(x>6277){printf("6287\n");return 0;}
else if(x>6271){printf("6277\n");return 0;}
else if(x>6269){printf("6271\n");return 0;}
else if(x>6263){printf("6269\n");return 0;}
else if(x>6257){printf("6263\n");return 0;}
else if(x>6247){printf("6257\n");return 0;}
else if(x>6229){printf("6247\n");return 0;}
else if(x>6221){printf("6229\n");return 0;}
else if(x>6217){printf("6221\n");return 0;}
else if(x>6211){printf("6217\n");return 0;}
else if(x>6203){printf("6211\n");return 0;}
else if(x>6199){printf("6203\n");return 0;}
else if(x>6197){printf("6199\n");return 0;}
else if(x>6173){printf("6197\n");return 0;}
else if(x>6163){printf("6173\n");return 0;}
else if(x>6151){printf("6163\n");return 0;}
else if(x>6143){printf("6151\n");return 0;}
else if(x>6133){printf("6143\n");return 0;}
else if(x>6131){printf("6133\n");return 0;}
else if(x>6121){printf("6131\n");return 0;}
else if(x>6113){printf("6121\n");return 0;}
else if(x>6101){printf("6113\n");return 0;}
else if(x>6091){printf("6101\n");return 0;}
else if(x>6089){printf("6091\n");return 0;}
else if(x>6079){printf("6089\n");return 0;}
else if(x>6073){printf("6079\n");return 0;}
else if(x>6067){printf("6073\n");return 0;}
else if(x>6053){printf("6067\n");return 0;}
else if(x>6047){printf("6053\n");return 0;}
else if(x>6043){printf("6047\n");return 0;}
else if(x>6037){printf("6043\n");return 0;}
else if(x>6029){printf("6037\n");return 0;}
else if(x>6011){printf("6029\n");return 0;}
else if(x>6007){printf("6011\n");return 0;}
else if(x>5987){printf("6007\n");return 0;}
else if(x>5981){printf("5987\n");return 0;}
else if(x>5953){printf("5981\n");return 0;}
else if(x>5939){printf("5953\n");return 0;}
else if(x>5927){printf("5939\n");return 0;}
else if(x>5923){printf("5927\n");return 0;}
else if(x>5903){printf("5923\n");return 0;}
else if(x>5897){printf("5903\n");return 0;}
else if(x>5881){printf("5897\n");return 0;}
else if(x>5879){printf("5881\n");return 0;}
else if(x>5869){printf("5879\n");return 0;}
else if(x>5867){printf("5869\n");return 0;}
else if(x>5861){printf("5867\n");return 0;}
else if(x>5857){printf("5861\n");return 0;}
else if(x>5851){printf("5857\n");return 0;}
else if(x>5849){printf("5851\n");return 0;}
else if(x>5843){printf("5849\n");return 0;}
else if(x>5839){printf("5843\n");return 0;}
else if(x>5827){printf("5839\n");return 0;}
else if(x>5821){printf("5827\n");return 0;}
else if(x>5813){printf("5821\n");return 0;}
else if(x>5807){printf("5813\n");return 0;}
else if(x>5801){printf("5807\n");return 0;}
else if(x>5791){printf("5801\n");return 0;}
else if(x>5783){printf("5791\n");return 0;}
else if(x>5779){printf("5783\n");return 0;}
else if(x>5749){printf("5779\n");return 0;}
else if(x>5743){printf("5749\n");return 0;}
else if(x>5741){printf("5743\n");return 0;}
else if(x>5737){printf("5741\n");return 0;}
else if(x>5717){printf("5737\n");return 0;}
else if(x>5711){printf("5717\n");return 0;}
else if(x>5701){printf("5711\n");return 0;}
else if(x>5693){printf("5701\n");return 0;}
else if(x>5689){printf("5693\n");return 0;}
else if(x>5683){printf("5689\n");return 0;}
else if(x>5669){printf("5683\n");return 0;}
else if(x>5659){printf("5669\n");return 0;}
else if(x>5657){printf("5659\n");return 0;}
else if(x>5653){printf("5657\n");return 0;}
else if(x>5651){printf("5653\n");return 0;}
else if(x>5647){printf("5651\n");return 0;}
else if(x>5641){printf("5647\n");return 0;}
else if(x>5639){printf("5641\n");return 0;}
else if(x>5623){printf("5639\n");return 0;}
else if(x>5591){printf("5623\n");return 0;}
else if(x>5581){printf("5591\n");return 0;}
else if(x>5573){printf("5581\n");return 0;}
else if(x>5569){printf("5573\n");return 0;}
else if(x>5563){printf("5569\n");return 0;}
else if(x>5557){printf("5563\n");return 0;}
else if(x>5531){printf("5557\n");return 0;}
else if(x>5527){printf("5531\n");return 0;}
else if(x>5521){printf("5527\n");return 0;}
else if(x>5519){printf("5521\n");return 0;}
else if(x>5507){printf("5519\n");return 0;}
else if(x>5503){printf("5507\n");return 0;}
else if(x>5501){printf("5503\n");return 0;}
else if(x>5483){printf("5501\n");return 0;}
else if(x>5479){printf("5483\n");return 0;}
else if(x>5477){printf("5479\n");return 0;}
else if(x>5471){printf("5477\n");return 0;}
else if(x>5449){printf("5471\n");return 0;}
else if(x>5443){printf("5449\n");return 0;}
else if(x>5441){printf("5443\n");return 0;}
else if(x>5437){printf("5441\n");return 0;}
else if(x>5431){printf("5437\n");return 0;}
else if(x>5419){printf("5431\n");return 0;}
else if(x>5417){printf("5419\n");return 0;}
else if(x>5413){printf("5417\n");return 0;}
else if(x>5407){printf("5413\n");return 0;}
else if(x>5399){printf("5407\n");return 0;}
else if(x>5393){printf("5399\n");return 0;}
else if(x>5387){printf("5393\n");return 0;}
else if(x>5381){printf("5387\n");return 0;}
else if(x>5351){printf("5381\n");return 0;}
else if(x>5347){printf("5351\n");return 0;}
else if(x>5333){printf("5347\n");return 0;}
else if(x>5323){printf("5333\n");return 0;}
else if(x>5309){printf("5323\n");return 0;}
else if(x>5303){printf("5309\n");return 0;}
else if(x>5297){printf("5303\n");return 0;}
else if(x>5281){printf("5297\n");return 0;}
else if(x>5279){printf("5281\n");return 0;}
else if(x>5273){printf("5279\n");return 0;}
else if(x>5261){printf("5273\n");return 0;}
else if(x>5237){printf("5261\n");return 0;}
else if(x>5233){printf("5237\n");return 0;}
else if(x>5231){printf("5233\n");return 0;}
else if(x>5227){printf("5231\n");return 0;}
else if(x>5209){printf("5227\n");return 0;}
else if(x>5197){printf("5209\n");return 0;}
else if(x>5189){printf("5197\n");return 0;}
else if(x>5179){printf("5189\n");return 0;}
else if(x>5171){printf("5179\n");return 0;}
else if(x>5167){printf("5171\n");return 0;}
else if(x>5153){printf("5167\n");return 0;}
else if(x>5147){printf("5153\n");return 0;}
else if(x>5119){printf("5147\n");return 0;}
else if(x>5113){printf("5119\n");return 0;}
else if(x>5107){printf("5113\n");return 0;}
else if(x>5101){printf("5107\n");return 0;}
else if(x>5099){printf("5101\n");return 0;}
else if(x>5087){printf("5099\n");return 0;}
else if(x>5081){printf("5087\n");return 0;}
else if(x>5077){printf("5081\n");return 0;}
else if(x>5059){printf("5077\n");return 0;}
else if(x>5051){printf("5059\n");return 0;}
else if(x>5039){printf("5051\n");return 0;}
else if(x>5023){printf("5039\n");return 0;}
else if(x>5021){printf("5023\n");return 0;}
else if(x>5011){printf("5021\n");return 0;}
else if(x>5009){printf("5011\n");return 0;}
else if(x>5003){printf("5009\n");return 0;}
else if(x>4999){printf("5003\n");return 0;}
else if(x>4993){printf("4999\n");return 0;}
else if(x>4987){printf("4993\n");return 0;}
else if(x>4973){printf("4987\n");return 0;}
else if(x>4969){printf("4973\n");return 0;}
else if(x>4967){printf("4969\n");return 0;}
else if(x>4957){printf("4967\n");return 0;}
else if(x>4951){printf("4957\n");return 0;}
else if(x>4943){printf("4951\n");return 0;}
else if(x>4937){printf("4943\n");return 0;}
else if(x>4933){printf("4937\n");return 0;}
else if(x>4931){printf("4933\n");return 0;}
else if(x>4919){printf("4931\n");return 0;}
else if(x>4909){printf("4919\n");return 0;}
else if(x>4903){printf("4909\n");return 0;}
else if(x>4889){printf("4903\n");return 0;}
else if(x>4877){printf("4889\n");return 0;}
else if(x>4871){printf("4877\n");return 0;}
else if(x>4861){printf("4871\n");return 0;}
else if(x>4831){printf("4861\n");return 0;}
else if(x>4817){printf("4831\n");return 0;}
else if(x>4813){printf("4817\n");return 0;}
else if(x>4801){printf("4813\n");return 0;}
else if(x>4799){printf("4801\n");return 0;}
else if(x>4793){printf("4799\n");return 0;}
else if(x>4789){printf("4793\n");return 0;}
else if(x>4787){printf("4789\n");return 0;}
else if(x>4783){printf("4787\n");return 0;}
else if(x>4759){printf("4783\n");return 0;}
else if(x>4751){printf("4759\n");return 0;}
else if(x>4733){printf("4751\n");return 0;}
else if(x>4729){printf("4733\n");return 0;}
else if(x>4723){printf("4729\n");return 0;}
else if(x>4721){printf("4723\n");return 0;}
else if(x>4703){printf("4721\n");return 0;}
else if(x>4691){printf("4703\n");return 0;}
else if(x>4679){printf("4691\n");return 0;}
else if(x>4673){printf("4679\n");return 0;}
else if(x>4663){printf("4673\n");return 0;}
else if(x>4657){printf("4663\n");return 0;}
else if(x>4651){printf("4657\n");return 0;}
else if(x>4649){printf("4651\n");return 0;}
else if(x>4643){printf("4649\n");return 0;}
else if(x>4639){printf("4643\n");return 0;}
else if(x>4637){printf("4639\n");return 0;}
else if(x>4621){printf("4637\n");return 0;}
else if(x>4603){printf("4621\n");return 0;}
else if(x>4597){printf("4603\n");return 0;}
else if(x>4591){printf("4597\n");return 0;}
else if(x>4583){printf("4591\n");return 0;}
else if(x>4567){printf("4583\n");return 0;}
else if(x>4561){printf("4567\n");return 0;}
else if(x>4549){printf("4561\n");return 0;}
else if(x>4547){printf("4549\n");return 0;}
else if(x>4523){printf("4547\n");return 0;}
else if(x>4519){printf("4523\n");return 0;}
else if(x>4517){printf("4519\n");return 0;}
else if(x>4513){printf("4517\n");return 0;}
else if(x>4507){printf("4513\n");return 0;}
else if(x>4493){printf("4507\n");return 0;}
else if(x>4483){printf("4493\n");return 0;}
else if(x>4481){printf("4483\n");return 0;}
else if(x>4463){printf("4481\n");return 0;}
else if(x>4457){printf("4463\n");return 0;}
else if(x>4451){printf("4457\n");return 0;}
else if(x>4447){printf("4451\n");return 0;}
else if(x>4441){printf("4447\n");return 0;}
else if(x>4423){printf("4441\n");return 0;}
else if(x>4421){printf("4423\n");return 0;}
else if(x>4409){printf("4421\n");return 0;}
else if(x>4397){printf("4409\n");return 0;}
else if(x>4391){printf("4397\n");return 0;}
else if(x>4373){printf("4391\n");return 0;}
else if(x>4363){printf("4373\n");return 0;}
else if(x>4357){printf("4363\n");return 0;}
else if(x>4349){printf("4357\n");return 0;}
else if(x>4339){printf("4349\n");return 0;}
else if(x>4337){printf("4339\n");return 0;}
else if(x>4327){printf("4337\n");return 0;}
else if(x>4297){printf("4327\n");return 0;}
else if(x>4289){printf("4297\n");return 0;}
else if(x>4283){printf("4289\n");return 0;}
else if(x>4273){printf("4283\n");return 0;}
else if(x>4271){printf("4273\n");return 0;}
else if(x>4261){printf("4271\n");return 0;}
else if(x>4259){printf("4261\n");return 0;}
else if(x>4253){printf("4259\n");return 0;}
else if(x>4243){printf("4253\n");return 0;}
else if(x>4241){printf("4243\n");return 0;}
else if(x>4231){printf("4241\n");return 0;}
else if(x>4229){printf("4231\n");return 0;}
else if(x>4219){printf("4229\n");return 0;}
else if(x>4217){printf("4219\n");return 0;}
else if(x>4211){printf("4217\n");return 0;}
else if(x>4201){printf("4211\n");return 0;}
else if(x>4177){printf("4201\n");return 0;}
else if(x>4159){printf("4177\n");return 0;}
else if(x>4157){printf("4159\n");return 0;}
else if(x>4153){printf("4157\n");return 0;}
else if(x>4139){printf("4153\n");return 0;}
else if(x>4133){printf("4139\n");return 0;}
else if(x>4129){printf("4133\n");return 0;}
else if(x>4127){printf("4129\n");return 0;}
else if(x>4111){printf("4127\n");return 0;}
else if(x>4099){printf("4111\n");return 0;}
else if(x>4093){printf("4099\n");return 0;}
else if(x>4091){printf("4093\n");return 0;}
else if(x>4079){printf("4091\n");return 0;}
else if(x>4073){printf("4079\n");return 0;}
else if(x>4057){printf("4073\n");return 0;}
else if(x>4051){printf("4057\n");return 0;}
else if(x>4049){printf("4051\n");return 0;}
else if(x>4027){printf("4049\n");return 0;}
else if(x>4021){printf("4027\n");return 0;}
else if(x>4019){printf("4021\n");return 0;}
else if(x>4013){printf("4019\n");return 0;}
else if(x>4007){printf("4013\n");return 0;}
else if(x>4003){printf("4007\n");return 0;}
else if(x>4001){printf("4003\n");return 0;}
else if(x>3989){printf("4001\n");return 0;}
else if(x>3967){printf("3989\n");return 0;}
else if(x>3947){printf("3967\n");return 0;}
else if(x>3943){printf("3947\n");return 0;}
else if(x>3931){printf("3943\n");return 0;}
else if(x>3929){printf("3931\n");return 0;}
else if(x>3923){printf("3929\n");return 0;}
else if(x>3919){printf("3923\n");return 0;}
else if(x>3917){printf("3919\n");return 0;}
else if(x>3911){printf("3917\n");return 0;}
else if(x>3907){printf("3911\n");return 0;}
else if(x>3889){printf("3907\n");return 0;}
else if(x>3881){printf("3889\n");return 0;}
else if(x>3877){printf("3881\n");return 0;}
else if(x>3863){printf("3877\n");return 0;}
else if(x>3853){printf("3863\n");return 0;}
else if(x>3851){printf("3853\n");return 0;}
else if(x>3847){printf("3851\n");return 0;}
else if(x>3833){printf("3847\n");return 0;}
else if(x>3823){printf("3833\n");return 0;}
else if(x>3821){printf("3823\n");return 0;}
else if(x>3803){printf("3821\n");return 0;}
else if(x>3797){printf("3803\n");return 0;}
else if(x>3793){printf("3797\n");return 0;}
else if(x>3779){printf("3793\n");return 0;}
else if(x>3769){printf("3779\n");return 0;}
else if(x>3767){printf("3769\n");return 0;}
else if(x>3761){printf("3767\n");return 0;}
else if(x>3739){printf("3761\n");return 0;}
else if(x>3733){printf("3739\n");return 0;}
else if(x>3727){printf("3733\n");return 0;}
else if(x>3719){printf("3727\n");return 0;}
else if(x>3709){printf("3719\n");return 0;}
else if(x>3701){printf("3709\n");return 0;}
else if(x>3697){printf("3701\n");return 0;}
else if(x>3691){printf("3697\n");return 0;}
else if(x>3677){printf("3691\n");return 0;}
else if(x>3673){printf("3677\n");return 0;}
else if(x>3671){printf("3673\n");return 0;}
else if(x>3659){printf("3671\n");return 0;}
else if(x>3643){printf("3659\n");return 0;}
else if(x>3637){printf("3643\n");return 0;}
else if(x>3631){printf("3637\n");return 0;}
else if(x>3623){printf("3631\n");return 0;}
else if(x>3617){printf("3623\n");return 0;}
else if(x>3613){printf("3617\n");return 0;}
else if(x>3607){printf("3613\n");return 0;}
else if(x>3593){printf("3607\n");return 0;}
else if(x>3583){printf("3593\n");return 0;}
else if(x>3581){printf("3583\n");return 0;}
else if(x>3571){printf("3581\n");return 0;}
else if(x>3559){printf("3571\n");return 0;}
else if(x>3557){printf("3559\n");return 0;}
else if(x>3547){printf("3557\n");return 0;}
else if(x>3541){printf("3547\n");return 0;}
else if(x>3539){printf("3541\n");return 0;}
else if(x>3533){printf("3539\n");return 0;}
else if(x>3529){printf("3533\n");return 0;}
else if(x>3527){printf("3529\n");return 0;}
else if(x>3517){printf("3527\n");return 0;}
else if(x>3511){printf("3517\n");return 0;}
else if(x>3499){printf("3511\n");return 0;}
else if(x>3491){printf("3499\n");return 0;}
else if(x>3469){printf("3491\n");return 0;}
else if(x>3467){printf("3469\n");return 0;}
else if(x>3463){printf("3467\n");return 0;}
else if(x>3461){printf("3463\n");return 0;}
else if(x>3457){printf("3461\n");return 0;}
else if(x>3449){printf("3457\n");return 0;}
else if(x>3433){printf("3449\n");return 0;}
else if(x>3413){printf("3433\n");return 0;}
else if(x>3407){printf("3413\n");return 0;}
else if(x>3391){printf("3407\n");return 0;}
else if(x>3389){printf("3391\n");return 0;}
else if(x>3373){printf("3389\n");return 0;}
else if(x>3371){printf("3373\n");return 0;}
else if(x>3361){printf("3371\n");return 0;}
else if(x>3359){printf("3361\n");return 0;}
else if(x>3347){printf("3359\n");return 0;}
else if(x>3343){printf("3347\n");return 0;}
else if(x>3331){printf("3343\n");return 0;}
else if(x>3329){printf("3331\n");return 0;}
else if(x>3323){printf("3329\n");return 0;}
else if(x>3319){printf("3323\n");return 0;}
else if(x>3313){printf("3319\n");return 0;}
else if(x>3307){printf("3313\n");return 0;}
else if(x>3301){printf("3307\n");return 0;}
else if(x>3299){printf("3301\n");return 0;}
else if(x>3271){printf("3299\n");return 0;}
else if(x>3259){printf("3271\n");return 0;}
else if(x>3257){printf("3259\n");return 0;}
else if(x>3253){printf("3257\n");return 0;}
else if(x>3251){printf("3253\n");return 0;}
else if(x>3229){printf("3251\n");return 0;}
else if(x>3221){printf("3229\n");return 0;}
else if(x>3217){printf("3221\n");return 0;}
else if(x>3209){printf("3217\n");return 0;}
else if(x>3203){printf("3209\n");return 0;}
else if(x>3191){printf("3203\n");return 0;}
else if(x>3187){printf("3191\n");return 0;}
else if(x>3181){printf("3187\n");return 0;}
else if(x>3169){printf("3181\n");return 0;}
else if(x>3167){printf("3169\n");return 0;}
else if(x>3163){printf("3167\n");return 0;}
else if(x>3137){printf("3163\n");return 0;}
else if(x>3121){printf("3137\n");return 0;}
else if(x>3119){printf("3121\n");return 0;}
else if(x>3109){printf("3119\n");return 0;}
else if(x>3089){printf("3109\n");return 0;}
else if(x>3083){printf("3089\n");return 0;}
else if(x>3079){printf("3083\n");return 0;}
else if(x>3067){printf("3079\n");return 0;}
else if(x>3061){printf("3067\n");return 0;}
else if(x>3049){printf("3061\n");return 0;}
else if(x>3041){printf("3049\n");return 0;}
else if(x>3037){printf("3041\n");return 0;}
else if(x>3023){printf("3037\n");return 0;}
else if(x>3019){printf("3023\n");return 0;}
else if(x>3011){printf("3019\n");return 0;}
else if(x>3001){printf("3011\n");return 0;}
else if(x>2999){printf("3001\n");return 0;}
else if(x>2971){printf("2999\n");return 0;}
else if(x>2969){printf("2971\n");return 0;}
else if(x>2963){printf("2969\n");return 0;}
else if(x>2957){printf("2963\n");return 0;}
else if(x>2953){printf("2957\n");return 0;}
else if(x>2939){printf("2953\n");return 0;}
else if(x>2927){printf("2939\n");return 0;}
else if(x>2917){printf("2927\n");return 0;}
else if(x>2909){printf("2917\n");return 0;}
else if(x>2903){printf("2909\n");return 0;}
else if(x>2897){printf("2903\n");return 0;}
else if(x>2887){printf("2897\n");return 0;}
else if(x>2879){printf("2887\n");return 0;}
else if(x>2861){printf("2879\n");return 0;}
else if(x>2857){printf("2861\n");return 0;}
else if(x>2851){printf("2857\n");return 0;}
else if(x>2843){printf("2851\n");return 0;}
else if(x>2837){printf("2843\n");return 0;}
else if(x>2833){printf("2837\n");return 0;}
else if(x>2819){printf("2833\n");return 0;}
else if(x>2803){printf("2819\n");return 0;}
else if(x>2801){printf("2803\n");return 0;}
else if(x>2797){printf("2801\n");return 0;}
else if(x>2791){printf("2797\n");return 0;}
else if(x>2789){printf("2791\n");return 0;}
else if(x>2777){printf("2789\n");return 0;}
else if(x>2767){printf("2777\n");return 0;}
else if(x>2753){printf("2767\n");return 0;}
else if(x>2749){printf("2753\n");return 0;}
else if(x>2741){printf("2749\n");return 0;}
else if(x>2731){printf("2741\n");return 0;}
else if(x>2729){printf("2731\n");return 0;}
else if(x>2719){printf("2729\n");return 0;}
else if(x>2713){printf("2719\n");return 0;}
else if(x>2711){printf("2713\n");return 0;}
else if(x>2707){printf("2711\n");return 0;}
else if(x>2699){printf("2707\n");return 0;}
else if(x>2693){printf("2699\n");return 0;}
else if(x>2689){printf("2693\n");return 0;}
else if(x>2687){printf("2689\n");return 0;}
else if(x>2683){printf("2687\n");return 0;}
else if(x>2677){printf("2683\n");return 0;}
else if(x>2671){printf("2677\n");return 0;}
else if(x>2663){printf("2671\n");return 0;}
else if(x>2659){printf("2663\n");return 0;}
else if(x>2657){printf("2659\n");return 0;}
else if(x>2647){printf("2657\n");return 0;}
else if(x>2633){printf("2647\n");return 0;}
else if(x>2621){printf("2633\n");return 0;}
else if(x>2617){printf("2621\n");return 0;}
else if(x>2609){printf("2617\n");return 0;}
else if(x>2593){printf("2609\n");return 0;}
else if(x>2591){printf("2593\n");return 0;}
else if(x>2579){printf("2591\n");return 0;}
else if(x>2557){printf("2579\n");return 0;}
else if(x>2551){printf("2557\n");return 0;}
else if(x>2549){printf("2551\n");return 0;}
else if(x>2543){printf("2549\n");return 0;}
else if(x>2539){printf("2543\n");return 0;}
else if(x>2531){printf("2539\n");return 0;}
else if(x>2521){printf("2531\n");return 0;}
else if(x>2503){printf("2521\n");return 0;}
else if(x>2477){printf("2503\n");return 0;}
else if(x>2473){printf("2477\n");return 0;}
else if(x>2467){printf("2473\n");return 0;}
else if(x>2459){printf("2467\n");return 0;}
else if(x>2447){printf("2459\n");return 0;}
else if(x>2441){printf("2447\n");return 0;}
else if(x>2437){printf("2441\n");return 0;}
else if(x>2423){printf("2437\n");return 0;}
else if(x>2417){printf("2423\n");return 0;}
else if(x>2411){printf("2417\n");return 0;}
else if(x>2399){printf("2411\n");return 0;}
else if(x>2393){printf("2399\n");return 0;}
else if(x>2389){printf("2393\n");return 0;}
else if(x>2383){printf("2389\n");return 0;}
else if(x>2381){printf("2383\n");return 0;}
else if(x>2377){printf("2381\n");return 0;}
else if(x>2371){printf("2377\n");return 0;}
else if(x>2357){printf("2371\n");return 0;}
else if(x>2351){printf("2357\n");return 0;}
else if(x>2347){printf("2351\n");return 0;}
else if(x>2341){printf("2347\n");return 0;}
else if(x>2339){printf("2341\n");return 0;}
else if(x>2333){printf("2339\n");return 0;}
else if(x>2311){printf("2333\n");return 0;}
else if(x>2309){printf("2311\n");return 0;}
else if(x>2297){printf("2309\n");return 0;}
else if(x>2293){printf("2297\n");return 0;}
else if(x>2287){printf("2293\n");return 0;}
else if(x>2281){printf("2287\n");return 0;}
else if(x>2273){printf("2281\n");return 0;}
else if(x>2269){printf("2273\n");return 0;}
else if(x>2267){printf("2269\n");return 0;}
else if(x>2251){printf("2267\n");return 0;}
else if(x>2243){printf("2251\n");return 0;}
else if(x>2239){printf("2243\n");return 0;}
else if(x>2237){printf("2239\n");return 0;}
else if(x>2221){printf("2237\n");return 0;}
else if(x>2213){printf("2221\n");return 0;}
else if(x>2207){printf("2213\n");return 0;}
else if(x>2203){printf("2207\n");return 0;}
else if(x>2179){printf("2203\n");return 0;}
else if(x>2161){printf("2179\n");return 0;}
else if(x>2153){printf("2161\n");return 0;}
else if(x>2143){printf("2153\n");return 0;}
else if(x>2141){printf("2143\n");return 0;}
else if(x>2137){printf("2141\n");return 0;}
else if(x>2131){printf("2137\n");return 0;}
else if(x>2129){printf("2131\n");return 0;}
else if(x>2113){printf("2129\n");return 0;}
else if(x>2111){printf("2113\n");return 0;}
else if(x>2099){printf("2111\n");return 0;}
else if(x>2089){printf("2099\n");return 0;}
else if(x>2087){printf("2089\n");return 0;}
else if(x>2083){printf("2087\n");return 0;}
else if(x>2081){printf("2083\n");return 0;}
else if(x>2069){printf("2081\n");return 0;}
else if(x>2063){printf("2069\n");return 0;}
else if(x>2053){printf("2063\n");return 0;}
else if(x>2039){printf("2053\n");return 0;}
else if(x>2029){printf("2039\n");return 0;}
else if(x>2027){printf("2029\n");return 0;}
else if(x>2017){printf("2027\n");return 0;}
else if(x>2011){printf("2017\n");return 0;}
else if(x>2003){printf("2011\n");return 0;}
else if(x>1999){printf("2003\n");return 0;}
else if(x>1997){printf("1999\n");return 0;}
else if(x>1993){printf("1997\n");return 0;}
else if(x>1987){printf("1993\n");return 0;}
else if(x>1979){printf("1987\n");return 0;}
else if(x>1973){printf("1979\n");return 0;}
else if(x>1951){printf("1973\n");return 0;}
else if(x>1949){printf("1951\n");return 0;}
else if(x>1933){printf("1949\n");return 0;}
else if(x>1931){printf("1933\n");return 0;}
else if(x>1913){printf("1931\n");return 0;}
else if(x>1907){printf("1913\n");return 0;}
else if(x>1901){printf("1907\n");return 0;}
else if(x>1889){printf("1901\n");return 0;}
else if(x>1879){printf("1889\n");return 0;}
else if(x>1877){printf("1879\n");return 0;}
else if(x>1873){printf("1877\n");return 0;}
else if(x>1871){printf("1873\n");return 0;}
else if(x>1867){printf("1871\n");return 0;}
else if(x>1861){printf("1867\n");return 0;}
else if(x>1847){printf("1861\n");return 0;}
else if(x>1831){printf("1847\n");return 0;}
else if(x>1823){printf("1831\n");return 0;}
else if(x>1811){printf("1823\n");return 0;}
else if(x>1801){printf("1811\n");return 0;}
else if(x>1789){printf("1801\n");return 0;}
else if(x>1787){printf("1789\n");return 0;}
else if(x>1783){printf("1787\n");return 0;}
else if(x>1777){printf("1783\n");return 0;}
else if(x>1759){printf("1777\n");return 0;}
else if(x>1753){printf("1759\n");return 0;}
else if(x>1747){printf("1753\n");return 0;}
else if(x>1741){printf("1747\n");return 0;}
else if(x>1733){printf("1741\n");return 0;}
else if(x>1723){printf("1733\n");return 0;}
else if(x>1721){printf("1723\n");return 0;}
else if(x>1709){printf("1721\n");return 0;}
else if(x>1699){printf("1709\n");return 0;}
else if(x>1697){printf("1699\n");return 0;}
else if(x>1693){printf("1697\n");return 0;}
else if(x>1669){printf("1693\n");return 0;}
else if(x>1667){printf("1669\n");return 0;}
else if(x>1663){printf("1667\n");return 0;}
else if(x>1657){printf("1663\n");return 0;}
else if(x>1637){printf("1657\n");return 0;}
else if(x>1627){printf("1637\n");return 0;}
else if(x>1621){printf("1627\n");return 0;}
else if(x>1619){printf("1621\n");return 0;}
else if(x>1613){printf("1619\n");return 0;}
else if(x>1609){printf("1613\n");return 0;}
else if(x>1607){printf("1609\n");return 0;}
else if(x>1601){printf("1607\n");return 0;}
else if(x>1597){printf("1601\n");return 0;}
else if(x>1583){printf("1597\n");return 0;}
else if(x>1579){printf("1583\n");return 0;}
else if(x>1571){printf("1579\n");return 0;}
else if(x>1567){printf("1571\n");return 0;}
else if(x>1559){printf("1567\n");return 0;}
else if(x>1553){printf("1559\n");return 0;}
else if(x>1549){printf("1553\n");return 0;}
else if(x>1543){printf("1549\n");return 0;}
else if(x>1531){printf("1543\n");return 0;}
else if(x>1523){printf("1531\n");return 0;}
else if(x>1511){printf("1523\n");return 0;}
else if(x>1499){printf("1511\n");return 0;}
else if(x>1493){printf("1499\n");return 0;}
else if(x>1489){printf("1493\n");return 0;}
else if(x>1487){printf("1489\n");return 0;}
else if(x>1483){printf("1487\n");return 0;}
else if(x>1481){printf("1483\n");return 0;}
else if(x>1471){printf("1481\n");return 0;}
else if(x>1459){printf("1471\n");return 0;}
else if(x>1453){printf("1459\n");return 0;}
else if(x>1451){printf("1453\n");return 0;}
else if(x>1447){printf("1451\n");return 0;}
else if(x>1439){printf("1447\n");return 0;}
else if(x>1433){printf("1439\n");return 0;}
else if(x>1429){printf("1433\n");return 0;}
else if(x>1427){printf("1429\n");return 0;}
else if(x>1423){printf("1427\n");return 0;}
else if(x>1409){printf("1423\n");return 0;}
else if(x>1399){printf("1409\n");return 0;}
else if(x>1381){printf("1399\n");return 0;}
else if(x>1373){printf("1381\n");return 0;}
else if(x>1367){printf("1373\n");return 0;}
else if(x>1361){printf("1367\n");return 0;}
else if(x>1327){printf("1361\n");return 0;}
else if(x>1321){printf("1327\n");return 0;}
else if(x>1319){printf("1321\n");return 0;}
else if(x>1307){printf("1319\n");return 0;}
else if(x>1303){printf("1307\n");return 0;}
else if(x>1301){printf("1303\n");return 0;}
else if(x>1297){printf("1301\n");return 0;}
else if(x>1291){printf("1297\n");return 0;}
else if(x>1289){printf("1291\n");return 0;}
else if(x>1283){printf("1289\n");return 0;}
else if(x>1279){printf("1283\n");return 0;}
else if(x>1277){printf("1279\n");return 0;}
else if(x>1259){printf("1277\n");return 0;}
else if(x>1249){printf("1259\n");return 0;}
else if(x>1237){printf("1249\n");return 0;}
else if(x>1231){printf("1237\n");return 0;}
else if(x>1229){printf("1231\n");return 0;}
else if(x>1223){printf("1229\n");return 0;}
else if(x>1217){printf("1223\n");return 0;}
else if(x>1213){printf("1217\n");return 0;}
else if(x>1201){printf("1213\n");return 0;}
else if(x>1193){printf("1201\n");return 0;}
else if(x>1187){printf("1193\n");return 0;}
else if(x>1181){printf("1187\n");return 0;}
else if(x>1171){printf("1181\n");return 0;}
else if(x>1163){printf("1171\n");return 0;}
else if(x>1153){printf("1163\n");return 0;}
else if(x>1151){printf("1153\n");return 0;}
else if(x>1129){printf("1151\n");return 0;}
else if(x>1123){printf("1129\n");return 0;}
else if(x>1117){printf("1123\n");return 0;}
else if(x>1109){printf("1117\n");return 0;}
else if(x>1103){printf("1109\n");return 0;}
else if(x>1097){printf("1103\n");return 0;}
else if(x>1093){printf("1097\n");return 0;}
else if(x>1091){printf("1093\n");return 0;}
else if(x>1087){printf("1091\n");return 0;}
else if(x>1069){printf("1087\n");return 0;}
else if(x>1063){printf("1069\n");return 0;}
else if(x>1061){printf("1063\n");return 0;}
else if(x>1051){printf("1061\n");return 0;}
else if(x>1049){printf("1051\n");return 0;}
else if(x>1039){printf("1049\n");return 0;}
else if(x>1033){printf("1039\n");return 0;}
else if(x>1031){printf("1033\n");return 0;}
else if(x>1021){printf("1031\n");return 0;}
else if(x>1019){printf("1021\n");return 0;}
else if(x>1013){printf("1019\n");return 0;}
else if(x>1009){printf("1013\n");return 0;}
else if(x>997){printf("1009\n");return 0;}
else if(x>991){printf("997\n");return 0;}
else if(x>983){printf("991\n");return 0;}
else if(x>977){printf("983\n");return 0;}
else if(x>971){printf("977\n");return 0;}
else if(x>967){printf("971\n");return 0;}
else if(x>953){printf("967\n");return 0;}
else if(x>947){printf("953\n");return 0;}
else if(x>941){printf("947\n");return 0;}
else if(x>937){printf("941\n");return 0;}
else if(x>929){printf("937\n");return 0;}
else if(x>919){printf("929\n");return 0;}
else if(x>911){printf("919\n");return 0;}
else if(x>907){printf("911\n");return 0;}
else if(x>887){printf("907\n");return 0;}
else if(x>883){printf("887\n");return 0;}
else if(x>881){printf("883\n");return 0;}
else if(x>877){printf("881\n");return 0;}
else if(x>863){printf("877\n");return 0;}
else if(x>859){printf("863\n");return 0;}
else if(x>857){printf("859\n");return 0;}
else if(x>853){printf("857\n");return 0;}
else if(x>839){printf("853\n");return 0;}
else if(x>829){printf("839\n");return 0;}
else if(x>827){printf("829\n");return 0;}
else if(x>823){printf("827\n");return 0;}
else if(x>821){printf("823\n");return 0;}
else if(x>811){printf("821\n");return 0;}
else if(x>809){printf("811\n");return 0;}
else if(x>797){printf("809\n");return 0;}
else if(x>787){printf("797\n");return 0;}
else if(x>773){printf("787\n");return 0;}
else if(x>769){printf("773\n");return 0;}
else if(x>761){printf("769\n");return 0;}
else if(x>757){printf("761\n");return 0;}
else if(x>751){printf("757\n");return 0;}
else if(x>743){printf("751\n");return 0;}
else if(x>739){printf("743\n");return 0;}
else if(x>733){printf("739\n");return 0;}
else if(x>727){printf("733\n");return 0;}
else if(x>719){printf("727\n");return 0;}
else if(x>709){printf("719\n");return 0;}
else if(x>701){printf("709\n");return 0;}
else if(x>691){printf("701\n");return 0;}
else if(x>683){printf("691\n");return 0;}
else if(x>677){printf("683\n");return 0;}
else if(x>673){printf("677\n");return 0;}
else if(x>661){printf("673\n");return 0;}
else if(x>659){printf("661\n");return 0;}
else if(x>653){printf("659\n");return 0;}
else if(x>647){printf("653\n");return 0;}
else if(x>643){printf("647\n");return 0;}
else if(x>641){printf("643\n");return 0;}
else if(x>631){printf("641\n");return 0;}
else if(x>619){printf("631\n");return 0;}
else if(x>617){printf("619\n");return 0;}
else if(x>613){printf("617\n");return 0;}
else if(x>607){printf("613\n");return 0;}
else if(x>601){printf("607\n");return 0;}
else if(x>599){printf("601\n");return 0;}
else if(x>593){printf("599\n");return 0;}
else if(x>587){printf("593\n");return 0;}
else if(x>577){printf("587\n");return 0;}
else if(x>571){printf("577\n");return 0;}
else if(x>569){printf("571\n");return 0;}
else if(x>563){printf("569\n");return 0;}
else if(x>557){printf("563\n");return 0;}
else if(x>547){printf("557\n");return 0;}
else if(x>541){printf("547\n");return 0;}
else if(x>523){printf("541\n");return 0;}
else if(x>521){printf("523\n");return 0;}
else if(x>509){printf("521\n");return 0;}
else if(x>503){printf("509\n");return 0;}
else if(x>499){printf("503\n");return 0;}
else if(x>491){printf("499\n");return 0;}
else if(x>487){printf("491\n");return 0;}
else if(x>479){printf("487\n");return 0;}
else if(x>467){printf("479\n");return 0;}
else if(x>463){printf("467\n");return 0;}
else if(x>461){printf("463\n");return 0;}
else if(x>457){printf("461\n");return 0;}
else if(x>449){printf("457\n");return 0;}
else if(x>443){printf("449\n");return 0;}
else if(x>439){printf("443\n");return 0;}
else if(x>433){printf("439\n");return 0;}
else if(x>431){printf("433\n");return 0;}
else if(x>421){printf("431\n");return 0;}
else if(x>419){printf("421\n");return 0;}
else if(x>409){printf("419\n");return 0;}
else if(x>401){printf("409\n");return 0;}
else if(x>397){printf("401\n");return 0;}
else if(x>389){printf("397\n");return 0;}
else if(x>383){printf("389\n");return 0;}
else if(x>379){printf("383\n");return 0;}
else if(x>373){printf("379\n");return 0;}
else if(x>367){printf("373\n");return 0;}
else if(x>359){printf("367\n");return 0;}
else if(x>353){printf("359\n");return 0;}
else if(x>349){printf("353\n");return 0;}
else if(x>347){printf("349\n");return 0;}
else if(x>337){printf("347\n");return 0;}
else if(x>331){printf("337\n");return 0;}
else if(x>317){printf("331\n");return 0;}
else if(x>313){printf("317\n");return 0;}
else if(x>311){printf("313\n");return 0;}
else if(x>307){printf("311\n");return 0;}
else if(x>293){printf("307\n");return 0;}
else if(x>283){printf("293\n");return 0;}
else if(x>281){printf("283\n");return 0;}
else if(x>277){printf("281\n");return 0;}
else if(x>271){printf("277\n");return 0;}
else if(x>269){printf("271\n");return 0;}
else if(x>263){printf("269\n");return 0;}
else if(x>257){printf("263\n");return 0;}
else if(x>251){printf("257\n");return 0;}
else if(x>241){printf("251\n");return 0;}
else if(x>239){printf("241\n");return 0;}
else if(x>233){printf("239\n");return 0;}
else if(x>229){printf("233\n");return 0;}
else if(x>227){printf("229\n");return 0;}
else if(x>223){printf("227\n");return 0;}
else if(x>211){printf("223\n");return 0;}
else if(x>199){printf("211\n");return 0;}
else if(x>197){printf("199\n");return 0;}
else if(x>193){printf("197\n");return 0;}
else if(x>191){printf("193\n");return 0;}
else if(x>181){printf("191\n");return 0;}
else if(x>179){printf("181\n");return 0;}
else if(x>173){printf("179\n");return 0;}
else if(x>167){printf("173\n");return 0;}
else if(x>163){printf("167\n");return 0;}
else if(x>157){printf("163\n");return 0;}
else if(x>151){printf("157\n");return 0;}
else if(x>149){printf("151\n");return 0;}
else if(x>139){printf("149\n");return 0;}
else if(x>137){printf("139\n");return 0;}
else if(x>131){printf("137\n");return 0;}
else if(x>127){printf("131\n");return 0;}
else if(x>113){printf("127\n");return 0;}
else if(x>109){printf("113\n");return 0;}
else if(x>107){printf("109\n");return 0;}
else if(x>103){printf("107\n");return 0;}
else if(x>101){printf("103\n");return 0;}
else if(x>97){printf("101\n");return 0;}
else if(x>89){printf("97\n");return 0;}
else if(x>83){printf("89\n");return 0;}
else if(x>79){printf("83\n");return 0;}
else if(x>73){printf("79\n");return 0;}
else if(x>71){printf("73\n");return 0;}
else if(x>67){printf("71\n");return 0;}
else if(x>61){printf("67\n");return 0;}
else if(x>59){printf("61\n");return 0;}
else if(x>53){printf("59\n");return 0;}
else if(x>47){printf("53\n");return 0;}
else if(x>43){printf("47\n");return 0;}
else if(x>41){printf("43\n");return 0;}
else if(x>37){printf("41\n");return 0;}
else if(x>31){printf("37\n");return 0;}
else if(x>29){printf("31\n");return 0;}
else if(x>23){printf("29\n");return 0;}
else if(x>19){printf("23\n");return 0;}
else if(x>17){printf("19\n");return 0;}
else if(x>13){printf("17\n");return 0;}
else if(x>11){printf("13\n");return 0;}
else if(x>7){printf("11\n");return 0;}
else if(x>5){printf("7\n");return 0;}
else if(x>3){printf("5\n");return 0;}
else if(x>2){printf("3\n");return 0;}
else {printf("2\n");return 0;}
}

Measured memory_bytes: 3312