class IntList {

    public static IntList catenate(IntList A, IntList B) {
        //TODO:  fill in method
        IntList res = new IntList(A.first, null);
        IntList ptr = res;
        A = A.rest;
        while (A != null) {
            ptr.rest = new IntList(A.first, null);
            ptr = ptr.rest;
            A = A.rest;
        }
        ptr.rest = B;
        return res;
    }

    public  IntList(int first0, IntList rest0);
    public  IntList();

}