#include <iostream>
#include <deque>
#include <iterator>
#include <numeric>
using namespace std;
int main ()
{
deque<int> d(5);
iota(d.begin(),d.end(),100);
deque<int>::iterator It = d.begin();
while ( It != d.end() )
cout << *It++ << " ";
cout << endl;
// last element of the deque
It = d.end()-1;
cout << *It << endl;
getchar();
return 0;
}