pubilc class Test{
public String getStr(){
String s=System.in();
Scanner san=new Scanner(s);
return san;
}
public static void main(String args[]){
System.out.println(new Test().getStr());
new Test().writetofile();
}
public void writetofile() throws Exception{
String text=this.getStr();
FileOutputStream fos=new FileOutputStream("a.txt");
fos.write(text);
fos.flush();
fos.close();
}
}