char s[];main(f,g){f=read(0,s)-1;g=!strcmp(s+f-2,"ai");write(1,s,f-2*g);puts("-AI"+g);}