import java.util.*;

class linkedlist 
{
    public static void main(String args[]) 
    {
        LinkedList linkedlist1 = new LinkedList();
        
        linkedlist1.add("Item 2");
        linkedlist1.add("Item 3");
        linkedlist1.add("Item 4");
        linkedlist1.add("Item 5");

        linkedlist1.addFirst("Item 0");
        linkedlist1.addLast("Item 6");

        linkedlist1.add(1, "Item 1");

        System.out.println(linkedlist1);

        linkedlist1.remove("Item 6");

        System.out.println(linkedlist1);

        linkedlist1.removeLast();

        System.out.println(linkedlist1);

        linkedlist1.set(3, "New Item");

        System.out.println(linkedlist1);
    }
}
