#include <cstdlib>
#include <stdlib.h>
#include <stdio.h>
#include <list>
#include<iostream>
using namespace std;
int main(int argc, char** argv) {
list<int> *adjV = new list<int>[3];
adjV[0].push_back(10);
adjV[0].push_front(20);
adjV[0].push_back(30);
adjV[1].push_back(45);
adjV[1].push_front(55);
adjV[1].push_back(65);
adjV[2].push_back(80);
adjV[2].push_front(90);
adjV[2].push_back(100);
for(int i = 0; i < 3; ++i) {
for (list<int>::iterator it = adjV[i].begin(); it!= adjV[i].end(); ++it){
cout<<*it<<endl;
}
}
return 0;
}
I2luY2x1ZGUgPGNzdGRsaWI+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxsaXN0PgojaW5jbHVkZTxpb3N0cmVhbT4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbihpbnQgYXJnYywgY2hhcioqIGFyZ3YpIHsKCiAgICBsaXN0PGludD4gKmFkalYgPSBuZXcgbGlzdDxpbnQ+WzNdOwoKICAgIGFkalZbMF0ucHVzaF9iYWNrKDEwKTsKICAgIGFkalZbMF0ucHVzaF9mcm9udCgyMCk7CiAgICBhZGpWWzBdLnB1c2hfYmFjaygzMCk7CgogICAgYWRqVlsxXS5wdXNoX2JhY2soNDUpOwogICAgYWRqVlsxXS5wdXNoX2Zyb250KDU1KTsKICAgIGFkalZbMV0ucHVzaF9iYWNrKDY1KTsKCiAgICBhZGpWWzJdLnB1c2hfYmFjayg4MCk7CiAgICBhZGpWWzJdLnB1c2hfZnJvbnQoOTApOwogICAgYWRqVlsyXS5wdXNoX2JhY2soMTAwKTsKCiAgICBmb3IoaW50IGkgPSAwOyBpIDwgMzsgKytpKSB7CiAgICAgICAgZm9yIChsaXN0PGludD46Oml0ZXJhdG9yIGl0ID0gYWRqVltpXS5iZWdpbigpOyBpdCE9IGFkalZbaV0uZW5kKCk7ICsraXQpewogICAgICAgICAgICBjb3V0PDwqaXQ8PGVuZGw7CiAgICAgICAgfQogICAgfQoKICAgIHJldHVybiAwOwp9Cg==