#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,a[10005],wh,wh1;
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>wh;
if(wh==1)
{
cin>>wh1;
a.push(wh1);
}
if(wh==2)
{
if(!a.empty())
a.pop();
else
cout<<"ERR_CANNOT_POP";
}
if(wh==3)
{
if(!a.empty())
a.front();
else
cout<<"ERR_CANNOT_QUERY";
}
if(wh==4)
{
cout<<a.size();
}
}
return 0;
}
```cpp