import java.util.*;
import java.io.*;public class ProducterAndConsumer {
final int max = 11;
String[] round; // =new String();
LinkedList list; // = new LinkedList();
int i; // =0;
String e; public ProducterAndConsumer() {
round = new String[max];
list = new LinkedList();
i = 0;
} public String product() {
// System.in.read(round[i]);
if (i > max - 1) {
System.out.println("Full");
}
return ;
list.addFirst(round[i]);
i++;
} public String consum() {
if (i < 0) {
System.out.println("Empty");
}
e = (String)list.getLast();
System.out.println("The   product   is   " + e);
i--;
}
public String(char[] value) {
} public static void main(String[] args) {
try {
ProducterAndConsumer pv = new ProducterAndConsumer();
InputStreamReader stin = new InputStreamReader(System.in);
BufferedReader bf = new BufferedReader(stin);
// System.in.read();
// if(1)
String value = "";
while (true) {
System.out
.println("Choose 1 and 2 to product or consum");
value = bf.readLine();
if (value == null) {
continue;
}
if (value.equals("1")) {
// product random data
pv.round[pv.i] = String.valueOf(Math.random() * 10);    //pv.round[pv.i] = new String((int)(Math.random() * 10));
pv.product();
} else if (value.equals("2")) {
pv.consum();
} else if (value.equalsIgnoreCase("quit")) {
System.out.println("Quit   the   application");
break;
} else {
System.out.println("You   input   a   wrong   number");
}
bf.close();
stin.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}