#include <iostream>
#include <list>
#include <algorithm>
#include <numeric>
using namespace std;
void print(list<int> &l){
list<int>::iterator it = l.begin();
while (it != l.end()){
cout << *(it++) << " ";
}
cout << endl;
}
int main(){
list<int> li1(5), li2(5);
iota(li1.begin(), li1.end(), 1);
iota(li2.begin(), li2.end(), 5);
cout << "li1:";
print(li1);
cout << "li2:";
print(li2);
li1.swap(li2);
cout << "After swapping:" << endl;
cout << "li1:";
print(li1);
cout << "li2:";
print(li2);
return 0;
}