/* package whatever; // don't place package name! */
import static java.
lang .
System .
out ;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
public static void main
( String [ ] a
) { out.println ( c( "Hello, this is [?] world!" ) ) ;
out.println ( c( "How about we build [?] big building. It will have [?] orange banana hanging out of [?] window." ) ) ;
out.println ( c( "[?] giant en le sky." ) ) ;
out.println ( c( "[?] yarn ball? [?] big one!" ) ) ;
out.println ( c( "[?] hour ago I met [?] European. " ) ) ;
out.println ( c( "Hey sir [Richard], how 'bout [?] cat?" ) ) ;
out.println ( c( "[?] dog is barking. [?] cat is scared!" ) ) ;
}
String x
[ ] = s.
split ( "\\ [\\ ?\\ ]" ,
2 ) , r
= x
[ 0 ] ; if ( x.length > 1 )
return r + ( r.matches ( "(.+[.!?] )|(^)$" ) ? "A" : "a" )
+ ( "aeiouAEIOU" .contains ( "" + x[ 1 ] .charAt ( 1 ) ) ? "n" : "" ) + c( x[ 1 ] ) ;
else
return r;
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IHN0YXRpYyBqYXZhLmxhbmcuU3lzdGVtLm91dDsgCgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGEpIHsKCQlvdXQucHJpbnRsbihjKCJIZWxsbywgdGhpcyBpcyBbP10gd29ybGQhIikpOwoJCW91dC5wcmludGxuKGMoIkhvdyBhYm91dCB3ZSBidWlsZCBbP10gYmlnIGJ1aWxkaW5nLiBJdCB3aWxsIGhhdmUgWz9dIG9yYW5nZSBiYW5hbmEgaGFuZ2luZyBvdXQgb2YgWz9dIHdpbmRvdy4iKSk7CgkJb3V0LnByaW50bG4oYygiWz9dIGdpYW50IGVuIGxlIHNre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