import java.io.*;

class ListNode {
  String info;
  ListNode next;
}


public class Lists {

  // print the elements of list lis
  public static void print(ListNode lis, PrintStream ps) { }

  // return the length of list lis
  public static int length(ListNode lis) { }

  // check whether the element s appears in list lis
  public static boolean search(ListNode lis, String s) { }

  // replace the content of the first occurrence of element old with element ne
  // in list lis
  public static ListNode modify(ListNode lis, String old, String ne) { }

  // replace the content of all occurrences of element old with element ne in
  // list lis
  public static ListNode modifyAll(ListNode lis, String old, String ne) { }

  // insert the element s in front of list lis
  public static ListNode insertFirst(ListNode lis, String s) { }

  // delete the first element of list lis
  // if lis is emtpy, do nothing
  public static ListNode deleteFirst(ListNode lis) { }

  // insert the element s after the given element in list lis
  public static ListNode insertAfter(ListNode lis, String s, String given) { }

  // insert the element s in last position of list lis
  // without generator node
  public static ListNode insertLast(ListNode lis, String s) { }

  // insert the element s in last position of list lis
  // using generator node
  public static ListNode insertLast2(ListNode lis, String s) { }

  // insert the element s before the given element in list lis
  // using generator node
  public static ListNode insertBefore(ListNode lis, String s, String given) { }

  // insert the element s before the given element in list lis
  // without generator node
  public static ListNode insertBefore2(ListNode lis, String s, String given) { }

  // delete the first occurrence of element s from list lis
  // using generator node
  public static ListNode delete(ListNode lis, String s) { }

  // delete the first occurrence of element s from list lis
  // without generator node
  public static ListNode delete2(ListNode lis, String s) { }

  // delete all occurrences of element s from list lis
  // using generator node
  public static ListNode deleteAll(ListNode lis, String s) { }

  // make a copy of list lis
  // without generator node
  public static ListNode copy2(ListNode lis) { }

  // invert list lis, using for the inverted list the nodes of lis
  public static ListNode invert(ListNode lis) { }

  // create a list whose elements are read from br
  public static ListNode read(BufferedReader br) throws IOException { }

  // create a list constituted by 3 nodes "A", "B", "C"
  public static ListNode create3NodesABC() { }


  public static void main(String[] args) throws IOException {
    //ListNode a = create3NodesABC();

    System.out.println("Insert the strings for the list, one per line");
    BufferedReader kbd = new BufferedReader(new InputStreamReader(System.in));
    ListNode a = read(kbd);

    boolean found = search(a,"C");
    System.out.println(found);
    System.out.println(length(a));
    print(a, System.out);
    
    a = insertFirst(a,"X");
    print(a, System.out);
    a = deleteFirst(a);
    print(a, System.out);
    
    a = insertAfter(a,"X","B");
    print(a, System.out);
    a = insertAfter(a,"X","C");
    print(a, System.out);

    a = delete(a,"X");
    print(a, System.out);
    a = delete(a,"X");
    print(a, System.out);
    
    a = insertBefore(a,"X","C");
    print(a, System.out);
    a = insertBefore(a,"X","A");
    print(a, System.out);
    a = insertAfter(a,"X","C");
    print(a, System.out);
    
    a = deleteAll(a,"X");
    print(a, System.out);

    ListNode ca = copy(a);
    print(ca, System.out);
    ca = insertBefore(ca,"X","C");
    print(ca, System.out);
    print(a, System.out);
    ca = invert(ca);
    print(ca, System.out);

    ca = insertLast(ca, "Z");
    print(ca, System.out);
    
  }
}
