#include #include #include using namespace std; using ll = long long int; const ll LONGINF = 1LL << 60; int main() { int N; scanf("%d", &N); N <<= 1; vector A(N), L(N+1), R(N+1); for(int i=0; i