#include<cstdio>
#include<iostream>
#include<algorithm>
#include<deque>
using namespace std;
deque<char> S,d;
int main()
{
d.push_back('o');
d.push_back('n');
d.push_back('g');
for(int i = 0;i < d.size(); i++) cout << d.at(i);
cout << endl;
//deque<int>::iterator it;
//for(it = d.begin();it != d.end(); it++)
//cout << *it;
d.push_front('r');
d.push_front('w');
for(int i = 0;i < d.size(); i++) cout << d.at(i);
cout << endl;
for(int i = d.size() - 1;i >= 0; i--) cout << d.at(i);
cout << endl;
//deque<int>::reverse_iterator it;
//for(it = d.rbegin();it != d.rend(); it++)
//cout << *it;
d.pop_front();
d.pop_front();
for(int i = 0;i < d.size(); i++) cout << d.at(i);
cout << endl;
d.pop_back();
d.pop_back();
for(int i = 0;i < d.size(); i++) cout << d.at(i);
cout << endl;
if(!d.empty()) d.clear();
cout << "_____________________\n";
S.push_back('a');
S.push_back('c');
S.push_back('c');
S.push_back('e');
S.push_back('p');
S.push_back('t');
S.push_back('e');
S.push_back('d');
cout << "S.size():" << S.size() << endl;
cout << "S.max_size():" << S.max_size() << endl;
//c.erase(pos)删除pos位置的元素c.erase(beg,end)删除区间为[beg,end)的元素
//c.erase(beg,end)删除区间为[beg,end)之间的元素
//c.insert(pos,num)在pos位置插入元素num
//c.insert(pos,n,num)在pos位置插入n个元素num
//c.insert(pos,beg,end)在pos位置插入区间为[beg,end)的元素
}