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

// reverse linked list

 class LL
 {public static input in = new input();

 public static void fill(LinkedList l)
  {for (int x = 1; x <= 10; x++)
    {
		l.add(new Integer((int)(Math.random()*100+1)));
}
  }


public static void reverse(LinkedList l)
  {
		int spot = 0;
		int size = l.size();
		while (spot < size)
		  {l.add(spot,l.removeLast());
			spot++;                    
	      }

  }

 public static void main(String[] args) throws IOException
  {LinkedList l = new LinkedList();
   fill(l);
   System.out.println(l);
   reverse(l);
   System.out.println(l);
}
}