import java.io.*;
import java.util.*;
// reverse linked list
class switchLinked
{public static input in = new input();
public static void fill(LinkedList l)
{for (int x = 1; x <= 9; x++)
{
l.add(new Integer((int)(Math.random()*100+1)));
}
}
public static void switcher(LinkedList l) // switch every other
{
int spot = 0;
int size = l.size();
Integer i;
while (spot < size-1)
{i = l.remove(spot+1);
l.add(spot,i);
spot+=2;
}
}
public static void main(String[] args) throws IOException
{LinkedList l = new LinkedList();
fill(l);
System.out.println(l);
switcher(l);
System.out.println(l);
}
}