import java.io.*;

public class LinkedList {
    private Node first;

    LinkedList() {
        first = null;
    }

    void addFront (int item) {
        first = new Node(item, first);
    }

    boolean empty() {
        return (first == null);
    }

    Node car() {
        return first;
    }

    LinkedList cdr() {
        LinkedList l = new LinkedList();
        l.first = first.next;
        return l;
    }
}

class Node {
    public int item;
    public Node next;

    Node(int item, Node next) {
        this.item = item;
        this.next = next;
    }
}