#include<bits/stdc++.h>
using namespace std;
const int N=1e6+100;
inline int Read()
{
int x=0,f=0;char ch=getchar();
while(ch<'0'||ch>'9')f|=ch=='-',ch=getchar();
while(ch>='0'&&ch<='9')x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
if(f)x=-x;return x;
}
inline void write(int x)
{
int buf[40],p=0;
if(x<0)putchar('-'),x=-x;
do{
buf[p++]=x%10;x/=10;
}whil