import java.io.*; import java.util.*; class Main { public static void main(String[] args) { MyScanner sc = new MyScanner(); out = new PrintWriter(new BufferedOutputStream(System.out)); int n=sc.nextInt(); int[]a=sc.nextIntArray(n); int[]x=sc.nextIntArray(n); int[]y=sc.nextIntArray(n); MinBIT m1=new MinBIT(); MinBIT p1=new MinBIT(); long[]dp=new long[n+1]; for(int i=0;i<=n;++i){ // update if(i0){ y=Math.min(y,bit[x]); x&=x-1; } return y; } }