#include <iostream>
#include <string>
using namespace std;
struct queue{
int storage[100000];
int start;
int finish;
queue(){
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;
}
string clear(){
finish = 0;
start = 0;
return "ok";
}
string exit(){
return "bye";
}
};
int main() {
string a;
queue x;
while(cin >> a){
if(a == "push"){
int n;
cin >> n;
x.push(n);
cout << "ok" << endl;
}
if(a == "pop"){
cout << x.pop() << endl;
}
if(a == "front"){
cout << x.front() << endl;
}
if(a == "size"){
cout << x.size() << endl;
}
if(a == "clear"){
cout << x.clear() << endl;
}
if(a == "exit"){
cout << x.exit() << endl;
return 0;
}
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKc3RydWN0IHF1ZXVlewoJaW50IHN0b3JhZ2VbMTAwMDAwXTsKCWludCBzdGFydDsKCWludCBmaW5pc2g7CglxdWV1ZSgpewoJCXN0YXJ0ID0gMDsKCQlmaW5pc2ggPSAwOwoJfQoKCXZvaWQgcHVzaChpbnQgbil7CgkJc3RvcmFnZVtmaW5pc2hdID0gbjsKCQlmaW5pc2grKzsKCX0KCglpbnQgcG9wKCl7CgkJaW50IGEgPSBzdG9yYWdlW3N0YXJ0XTsKCQlzdGFydCsrOwoJCXJldHVybiBhOwoJfQoKCWludCBmcm9udCgpewoJCXJldHVybiBzdG9yYWdlW3N0YXJ0XTsKCX0KCglpbnQgc2l6ZSgpewoJCXJldHVybiBmaW5pc2ggLSBzdGFydDsKCX0KCglzdHJpbmcgY2xlYXIoKXsKCQlmaW5pc2ggPSAwOwoJCXN0YXJ0ID0gMDsKCQlyZXR1cm4gIm9rIjsKCX0KCglzdHJpbmcgZXhpdCgpewoJCXJldHVybiAiYnllIjsKCX0KfTsKCmludCBtYWluKCkgewoJc3RyaW5nIGE7CglxdWV1ZSB4Ow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