//c2java.java
import java.io.*;
import java.util.*;
//You can extends this class ..
// .. so that you can quickly translate your C into Java program
class c2java {
   BufferedReader cin = null;
   PrintStream cout = null;
   PrintStream cerr = null;
   c2java( ) { prepareIO( );  } // constructor
   void prepareIO( ) {
      try {
       cin = new BufferedReader(
        new InputStreamReader(System.in) );
      }catch(Exception e) {;}
      cout = System.out;
      cerr = System.err;
   }
   void printf(String fmt, Object... oo) {
        System.out.printf(fmt, oo); 
   }//printf
   void print(String fmt, Object... oo) {
        System.out.printf(fmt, oo); 
   }
   void println(String fmt, Object... oo) {
        System.out.printf(fmt+"\n", oo); 
   }//println
   int atol(String s) {   // atoi, atol
      int ans = 0;
      try {
        ans = Integer.parseInt(s);
      }catch(Exception e) { ; }
      return ans;
   }//atol
   double atof(String s) {
      double ans = 0;
      try {
        ans = Double.parseDouble(s);
      }catch(Exception e) { ; }
      return ans;
   }//atof
   int rand( ) {
      return (int) ( Math.random() * (1.0 + Integer.MAX_VALUE) );
   }//rand
   void srand(int x) {
      return;
   }
   String fgets( ) {
      String buf=null;
      try{
         buf = cin.readLine( );
      }catch(Exception e){;}
      return buf;
   }//fgets
}//calss c2java 
