#include <vector>
#include <iostream>
#include <algorithm>
#include <iterator>
enum{FIRST, SECOND};
int query(std::vector<int>& v, int type)
{
int start, end;
if(type == FIRST)
{
std::cin >> start;
v.erase(v.begin() + start - 1);
return 1;
}
if(type == SECOND)
{
std::cin >> start >> end;
v.erase(v.begin() + start - 1, v.begin() + end - 1);
return 1;
}
return -1;
}
void answer(std::vector<int>& v)
{
if(v.size() > 0)
{
std::cout << v.size() << std::endl;
std::copy(v.begin(), v.end(), std::ostream_iterator<int>(std::cout, " "));
}
}
int main() {
int n, value; // number of elements
std::vector<int> numbers;
std::cin >> n;
for(int i = 0; i < n; i++)
{
std::cin >> value;
numbers.push_back(value);
}
query(numbers, FIRST);
query(numbers, SECOND);
answer(numbers);
return 0;
}
I2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8aXRlcmF0b3I+CgplbnVte0ZJUlNULCBTRUNPTkR9OwoKaW50IHF1ZXJ5KHN0ZDo6dmVjdG9yPGludD4mIHYsIGludCB0eXBlKQp7CiAgICBpbnQgc3RhcnQsIGVuZDsKICAgIGlmKHR5cGUgPT0gRklSU1QpCiAgICB7CiAgICAgICAgc3RkOjpjaW4gPj4gc3RhcnQ7CiAgICAgICAgdi5lcmFzZSh2LmJlZ2luKCkgKyBzdGFydCAtIDEpOwogICAgICAgIHJldHVybiAxOwogICAgfQogICAgaWYodHlwZSA9PSBTRUNPTkQpCiAgICB7CiAgICAgICAgc3RkOjpjaW4gPj4gc3RhcnQgPj4gZW5kOwogICAgICAgIHYuZXJhc2Uodi5iZWdpbigpICsgc3RhcnQgLSAxLCB2LmJlZ2luKCkgKyBlbmQgLSAxKTsKICAgICAgICByZXR1cm4gMTsKICAgIH0KICAgIHJldHVybiAtMTsKfQoKdm9pZCBhbnN3ZXIoc3RkOjp2ZWN0b3I8aW50PiYgdikKewogICAgaWYodi5zaXplKCkgPiAwKQogICAgewogICA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