class replace
{
public static void main(String sent,String fword,String rword)
{
int wlen=fword.length();
int pos,n;
n=0;
String prev,next;
do
{
pos=sent.indexOf(fword);
if(pos!=-1)
{
n=pos+wlen;
prev=sent.substring(0,pos);
next=sent.substring(n);
sent=prev+rword+next;
}//end of if
}while(pos !=1);
System.out.println("modified sentence:"+ sent);
}//end of main
}//endof class
class replace
{
public static void main(Str