#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define N (1000000000+7) //#define N 998244353 #define INF 1e16 typedef long long ll; typedef pair P; typedef pair Q; const int inf = (int)1e9; int main(void){ int n; cin>>n; vectora(n); for(int i=0;i>a[i]; reverse(a.begin(),a.end()); sets1,s2; s1.insert(a[0]); for(int i=1;i