package com.wu;
import java.util.Scanner;
class DoubleLinkedList {
private DoubleLinkedListNode head;
private DoubleLinkedListNode mark;
private int length;
public int getLength() {
return length;
}
void create(){
Scanner in = new Scanner(System.in);
head = new DoubleLinkedListNode(in.nextInt());
++length;
mark = head;
int data;
while((data = in.nextInt()) != -1){
DoubleLinkedListNode q = new DoubleLinkedListNode(data);
head.setRight(q);
q.setLeft(head);
head = q;
++length;
}
in.close();
}
void print(){
//DoubleLinkedListNode p = head;
while(mark.getRight() != null) {
System.out.print(mark.getData() + " ");
mark = mark.getRight();
}
System.out.print(mark.getData());
}
}