#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define REP(i,n) for(int (i)=0;(i)<(n);(i)++) #define FOR(i,a,b) for(int (i)=(a);(i)<(b);(i)++) #define RREP(i,a) for(int (i)=(a)-1;(i)>=0;(i)--) #define FORR(i,a,b) for(int (i)=(a)-1;(i)>=(b);(i)--) typedef long long LL; typedef unsigned long long ULL; using namespace std; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; int main(){ int N; cin>>N; vector a(N),aa(N); REP(i,N){ cin>>a[i]; aa[i]=a[i]; } sort(a.begin(),a.end()); if(a[N-1]==aa[N-1]){ REP(i,N){ if(a[0]==aa[i]){ cout<