#include <iostream>
using namespace std;
int main() {
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
int min1=a[0];
int min2=a[1];
for(int i=0;i<n;i++){
if(a[i] < min1){
min2=min1;
min1=a[i];
}
if(a[i] < min2 && a[i] != min1){
min2=a[i];
}
cout<<min1<<"-->"<<min2<<"\n";
}
// cout<<min1<<" "<<min2;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgbjsKCWNpbj4+bjsKCWludCBhW25dOwoJZm9yKGludCBpPTA7aTxuO2krKyl7CgkJY2luPj5hW2ldOwoJfQoJaW50IG1pbjE9YVswXTsKCWludCBtaW4yPWFbMV07Cglmb3IoaW50IGk9MDtpPG47aSsrKXsKCQkgaWYoYVtpXSA8IG1pbjEpewoJCSAJIG1pbjI9bWluMTsKCQkgCSBtaW4xPWFbaV07CgkJIH0KCQkgaWYoYVtpXSA8IG1pbjIgJiYgYVtpXSAhPSBtaW4xKXsKCQkgCW1pbjI9YVtpXTsKCQkgfQoJCSBjb3V0PDxtaW4xPDwiLS0+Ijw8bWluMjw8IlxuIjsKCX0KLy8JY291dDw8bWluMTw8IiAiPDxtaW4yOwoJcmV0dXJuIDA7Cn0=