#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
vector<int>v;
int n;
cin >> n;
for(int i = 0; i < n; i++){
int number;
cin >> number;
v.push_back(number);
}
for(int i = 0; i < n; i++){
cout << v[i] << " " ;
}
cout << endl;
for(size_t i = 0; i < v.size(); i++){
cout << v[i] << " ";
}
cout << endl;
v.pop_back();
for(size_t i = 0; i < v.size(); i++){
cout << v[i] << " ";
}
cout << endl;
cout << v.front() << " " << v.back() << endl;
sort(v.begin(), v.end());
for(size_t i = 0; i < v.size(); i++){
cout << v[i] << " ";
}
cout << endl;
cout << v.size()<< endl;
int m = 3;
vector<int>::iterator it = find(v.begin(), v.end(), m);
if (it != v.end()){
cout << "true" << endl;
}
else{
cout << "false" << endl;
}
v.clear();
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8YWxnb3JpdGhtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7Cgl2ZWN0b3I8aW50PnY7CglpbnQgbjsKCWNpbiA+PiBuOwoJZm9yKGludCBpID0gMDsgaSA8IG47IGkrKyl7CglpbnQgbnVtYmVyOwoJY2luID4+IG51bWJlcjsKCXYucHVzaF9iYWNrKG51bWJlcik7Cgl9Cglmb3IoaW50IGkgPSAwOyBpIDwgbjsgaSsrKXsKCWNvdXQgPDwgdltpXSA8PCAiICIgOwoJfQoJY291dCA8PCBlbmRsOwoJZm9yKHNpemVfdCBpID0gMDsgaSA8IHYuc2l6ZSgpOyBpKyspewoJY291dCA8PCB2W2ldIDw8ICIgIjsKCX0KCWNvdXQgPDwgZW5kbDsKCXYucG9wX2JhY2soKTsKCWZvcihzaXplX3QgaSA9IDA7IGkgPCB2LnNpemUoKTsgaSsrKXsKCWNvdXQgPDwgIHZbaV0gPDwgIiAiOwoJfQoJY291dCA8PCBlbmRsOwoJY291dCA8PCB2LmZyb250KCkgPDwgIiAiIDw8IHYuYmFjaygpIDw8IG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