import java.util.*;
import java.lang.*;
import java.io.*;
class MyQueue {
int[] storage = new int[100000];
int start;
int finish;
MyQueue() {
start = 0;
finish = 0;
}
void push(int n) {
storage[finish] = n;
finish++;
}
int pop() {
int a = storage[start];
start++;
return a;
}
int front() {
return storage[start];
}
int size() {
return finish - start;
}
finish = 0;
start = 0;
return "ok";
}
return "bye";
}
}
public class Main {
MyQueue x = new MyQueue();
try (Scanner sc
= new Scanner
(System.
in)) { while (sc.hasNextLine()){
a = sc.next();
if (a.equals("push")) {
int n;
n = sc.nextInt();
x.push(n);
}
if (a.equals("pop")) {
}
if (a.equals("front")) {
System.
out.
println(x.
front()); }
if (a.equals("size")) {
}
if (a.equals("clear")) {
System.
out.
println(x.
clear()); }
if (a.equals("exit")) {
break;
}
}
}
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBNeVF1ZXVlIHsKICAgIGludFtdIHN0b3JhZ2UgPSBuZXcgaW50WzEwMDAwMF07CiAgICBpbnQgc3RhcnQ7CiAgICBpbnQgZmluaXNoOwogICAgTXlRdWV1ZSgpIHsKICAgICAgICBzdGFydCA9IDA7CiAgICAgICAgZmluaXNoID0gMDsKICAgIH0KICAgIHZvaWQgcHVzaChpbnQgbikgewogICAgICAgIHN0b3JhZ2VbZmluaXNoXSA9IG47CiAgICAgICAgZmluaXNoKys7CiAgICB9CiAgICBpbnQgcG9wKCkgewogICAgICAgIGludCBhID0gc3RvcmFnZVtzdGFydF07CiAgICAgICAgc3RhcnQrKzsKICAgICAgICByZXR1cm4gYTsKICAgIH0KICAgIGludCBmcm9udCgpIHsKICAgICAgICByZXR1cm4gc3RvcmFnZVtzdGFydF07CiAgICB9CiAgICBpbnQgc2l6ZSgpIHsKICAgICAgICByZXR1cm4gZmluaXNoIC0gc3RhcnQ7CiAgICB9CgogICAgU3RyaW5nIGNsZWFyKCkgewogICAgICAgIGZpbmlzaCA9IDA7CiA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