#include <iostream>
#include <list>
using namespace std;
int main() {
std::list<int> tempList;
for (int i = 0; i < 10; ++i)
tempList.push_back(i);
for (auto it = tempList.begin(); it != tempList.end(); ++it)
cout << *it << endl;
for (auto it = tempList.begin(); it != tempList.end(); ++it)
cout << *it * 2 << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bGlzdD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgewoJc3RkOjpsaXN0PGludD4gdGVtcExpc3Q7Cglmb3IgKGludCBpID0gMDsgaSA8IDEwOyArK2kpCgkJdGVtcExpc3QucHVzaF9iYWNrKGkpOwoJCQoJZm9yIChhdXRvIGl0ID0gdGVtcExpc3QuYmVnaW4oKTsgaXQgIT0gdGVtcExpc3QuZW5kKCk7ICsraXQpIAoJCWNvdXQgPDwgKml0IDw8IGVuZGw7Cglmb3IgKGF1dG8gaXQgPSB0ZW1wTGlzdC5iZWdpbigpOyBpdCAhPSB0ZW1wTGlzdC5lbmQoKTsgKytpdCkKCQljb3V0IDw8ICppdCAqIDIgPDwgZW5kbDsKCXJldHVybiAwOwp9