#include <iostream>
using namespace std;
int main() {
int n, a, b;
cin >> n;
cin >> a;
for(int i = 0; i < n; i++) {
cin >> b;
if(b > a) {
cout << b << " ";
}
a = b;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgbiwgYSwgYjsKCWNpbiA+PiBuOwoJY2luID4+IGE7Cglmb3IoaW50IGkgPSAwOyBpIDwgbjsgaSsrKSB7CiAgICAgICBjaW4gPj4gYjsKICAgICAgIGlmKGIgPiBhKSB7CiAgICAgICAgICBjb3V0IDw8IGIgPDwgIiAiOwogICAgICAgfQogICAgCWEgPSBiOwoJfQogICAgcmV0dXJuIDA7Cn0=