// by Dan Joyce
// provides two input routines, nextint and nextsubstring

package common;

import java.io.*;
import java.util.StringTokenizer;

/********************************************************************/

public class doinput {


  static String s = " ";                
  static DataInputStream stdin = new DataInputStream(System.in);
  static StringTokenizer s_tok = new StringTokenizer(s);

  public static int nextint() throws java.io.IOException {  
  /* Will return the next integer from the Input Stream.
     Assumes that at least one more integer
     remains in the input stream
  */
  int n;                               

  while (s_tok.countTokens() == 0) {
    s = stdin.readLine();       
    s_tok = new StringTokenizer(s);
    };
  n = Integer.parseInt (s_tok.nextToken());
  return n;
  };

  public static String nextsubstring() throws java.io.IOException{
  /* Will return the next substring from the Input Stream.
     Assumes that at least one more substring 
     remains in the input stream
  */
  String Str;

  while (s_tok.countTokens() == 0) {
    s = stdin.readLine();       
    s_tok = new StringTokenizer(s);
    };
  Str = s_tok.nextToken();
  return Str;
  };

}

