#include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; const ll INF=1LL<<60; typedef pair P; typedef pair PP; const ll MOD=998244353; const double PI=acos(-1); int main(){ int N; cin>>N; vector A(N),B(N); for(int i=0;i>A[i]; } for(int i=0;i>B[i]; } vector> C(5,vector(N)); for(int i=0;iB[i]) swap(A[i],B[i]); //A[i]<=B[i] } //C[i][1]<=C[i][2]<=C[i][3] for(int i=0;i mini; for(int i=0;i,greater> pq; for(int i=0;i