import java.io.IOException; import java.io.InputStream; import java.util.Arrays; import java.util.NoSuchElementException; public class Main { public static void main(String[] args) { new Main().run(); } class SegTree { int n=1; int[] v; public SegTree(int n_) { while (n0) { k=(k-1)/2; v[k]=v[2*k+1]+v[2*k+2]; } } int query(int a,int b) { return query(0,n,a,b,0); } int query(int l,int r,int a,int b,int k) { if (a<=l&&r<=b) return v[k]; else if (r<=a||b<=l) return 0; else { int vl=query(l,(l+r)/2,a,b,2*k+1); int vr=query((l+r)/2,r,a,b,2*k+2); return vl+vr; } } } void run() { FastScanner sc=new FastScanner(); int N=sc.nextInt(); int[] A=new int[N]; int[] B=new int[N]; int[] C=new int[N]; for (int i=0;i