public static int getMid(int[] a, int as, int ae, int[] b, int bs, int be, int n) {
		if (a[as] >= b[be]) {
			System.out.println(n);
			if (be - bs + 1 == n)
				return b[be];
			else 
				return a[as - 1] > b[be - 1] ? a[as - 1] : b[be - 1];
		}
		if (b[bs] >= a[ae]) {
			System.out.println(n);
			if (ae - as + 1 == n)
				return a[ae];
			else 
				return a[ae - 1] > b[bs - 1] ? a[ae - 1] : b[bs - 1];
		}
		int am = (ae + as) / 2;
		int bm = (be + bs) / 2;
		if (a[am] > b[bm]) {
			return getMid(a, as, am, b, bm + 1, be, (n - (bm - bs + 1)));
		} else {
			return getMid(a, am + 1, ae, b, bs, bm, (n - (am - as + 1)));
		}
	}