/** HeadsTails.java
    Given a string as a command line parameter, print out all its
    proper heads and tails.
    The result of the call
	java HeadsTails 12345 
    is
	1       2345
	12      345
	123     45
	1234    5
    Note that in Java, contrary to C and C++, the command line parameters
    do not include the name of the program. 
    Thus the only parameter in the call above
    is the String "12345".
    Note that the substring method of the String class,
    applied to the object "abcde" and given as parameters 2 and 4,
    will return "cd".
 */

import java.io.*;

public class HeadsTails {
   public static void main(String[] args) {
      if (args.length > 0) { // We need to check that there is an
			     // argument
         String s = args[0];
         int len = s.length();
         for (int k = 1; k < len; k++) {
	    System.out.print(s.substring(0,k));
	    System.out.println("\t" + s.substring(k,len));
         }
      }
      System.exit(0);
   }
}
