public static void main(String[] argv) {
    // input a list in reverse order.
    Random gen = new Random();
    node_t<Integer> head = null;
    int n = 0;
    if (argv.length > 1) {
      for (int i = 0; i < argv.length; ++i) {
        node_t<Integer> curr =
            new node_t<Integer>(Integer.parseInt(argv[i]), null);
        curr.next = head;
        head = curr;
      }
    } else {
      if (argv.length == 1) {
        n = Integer.parseInt(argv[0]);
      } else {
        n = gen.nextInt(1000) + 1;
      }
      for (int i = n - 1; i >= 0; --i) {
        node_t<Integer> curr = new node_t<Integer>(i, null);
        curr.next = head;
        head = curr;
      }
    }
    node_t<Integer> ans = even_odd_merge(head);
    int x = 0;
    while (ans != null) {
      if (argv.length <= 1) {
        assert(x == ans.data);
        x += 2;
        if (x >= n) {
          x = 1;
        }
      }
      System.out.println(ans.data);
      ans = ans.next;
    }
  }