#include #include #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) #define rep2(i,m,n) for(int (i)=(m);(i)<(n);(i)++) #define rep2ll(i,m,n) for(ll (i)=(m);(i)<(n);(i)++) #define ALL(obj) (obj).begin(), (obj).end() #define rALL(obj) (obj).rbegin(), (obj).rend() using namespace std; using ll = long long; using P = pair; using mint = atcoder::modint998244353; using VL = vector; using VVL = vector; using VVVL = vector; using VM = vector; using VVM = vector; using VVVM = vector; using VD = vector; using VVD = vector; using VVVD = vector; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b>n; VL a(n); rep(i,n) cin>>a[i]; ll L, R; set s; rep(i,n){ if(s.count(a[i])) break; s.insert(a[i]); R = i + 1; } s.clear(); for(int i=n-1; i>=0; i--){ if(s.count(a[i])) break; s.insert(a[i]); L = i - 1; } chmax(L, 0LL); chmin(R, n-1); VL ans; rep2(i,L,R) ans.push_back(i); cout<