#include<iostream>
#include<vector>
#include<iterator>
#include<numeric>
using namespace std;
int main()
{
vector<int> v(5);
iota(v.begin(),v.end(),1);
vector<int>::iterator It = v.begin();
while(It != v.end())
cout<<*It++<<" ";
cout<<endl;
It = v.end() - 1;
cout<<*It<<endl;
getchar();
return 0;
}