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



public class jumblemain
 {public static input in = new input();   // input library


  public static void main(String[] args) throws IOException  // always need main program
   {int num;
    ListNode top= null;
    System.out.println("Enter a number or - 1 to end");
    num = in.getInt();
    while (num != -1)
       {top = new ListNode(new Integer(num),top);
         System.out.println("Enter a number or - 1 to end");
          num = in.getInt();
	    }

    while (top != null)
     {System.out.println(top.getValue());
      top = top.getNext();
     }
  }
}