#include <queue>
#include <cstdio>
#include <iostream>
using namespace std;
int main()
{
queue<int> q;
int n;
cin>>n;
for(int i=1;i<=n;i++)
{
int a;
cin>>a;
q.push(a);
}
cout<<q.front()<<endl;//返回队列队首元素
cout<<q.back()<<endl;//返回队列末尾元素
cout<<q.size()<<endl;//返回队列大小
for(int i=1;i<=3;i++)
{
q.pop();
}
while(!q.empty())
{
cout<<q.front()<<" ";
q.pop();
}
}
11-02