快读快写
char buf[1<<20],*buf1,*buf2;
#define gc() (buf1==buf2&&(buf2=(buf1=buf)+fread(buf,1,1<<20,stdin)),*buf1++)
ll read()
{
ll ans=0,f=1;
char t=gc();
while(!isdigit(t))
{
if(t=='-')f=-1;
t=gc();
}
while(isdigit(t))
{
ans=(ans<<3)+(ans<<1)+(t^48);
t=gc();
}
return ans*f;
}
void write(ll x)
{
if(x<0)putchar('-'),x=-x;
if(x>9)write(x/10);
putchar((x%10)^48);
}