import java.util.Random;

public class Test25 {
    static final int RANGE = 1024*64;
    static int RANGEX = RANGE;

    static int NINE = 9;

    private static final Random random = new Random();

    public static void main(String[] strArr) {
        byte a[] = new byte[RANGE];
        byte b[] = new byte[RANGE];
	for (int i = 0; i < 100; i++) {
            for (int j = 0; j < a.length; j++) {
                a[j] = (byte)random.nextInt();
                b[j] = (byte)random.nextInt();
            }
            System.out.println("i: " + i);
            byte[] a_ref = a.clone();
            byte[] b_ref = b.clone();
            byte[] a_res = a.clone();
            byte[] b_res = b.clone();
            test25_ref(a_ref, a_ref, i % 2);
            test25(a_res, a_res, i % 2);
            verify("a", a_ref, a_res, a);
            verify("b", b_ref, b_res, b);
        }
    }

    static void verify(String name, byte[] ref, byte[] res, byte[] orig) {
        boolean fail = false;
        for (int j = 0; j < ref.length; j++) {
            if (ref[j] != res[j]) {
                System.out.println("Bad: " + j + ":" + ref[j] + " vs " + res[j] + " from " + orig[j]);
                fail = true;
            }
        }
        if (fail) {
            throw new RuntimeException("bad " + name);
        }
    }

    static void test25(byte[] a, byte[] b, int inv) {
        for (int i = 0; i < RANGE-4; i+=4) {
            a[i +  0]++;
            a[i +  1]++;
            a[i +  2]++;
            a[i +  3]++;
            b[inv + i +  0]++;
            b[inv + i +  1]++;
            b[inv + i +  2]++;
            b[inv + i +  3]++;
        }
    }

    static void test25_ref(byte[] a, byte[] b, int inv) {
        for (int i = 0; i < RANGE-4; i+=4) {
            a[i +  0]++;
            a[i +  1]++;
            a[i +  2]++;
            a[i +  3]++;
            b[inv + i +  0]++;
            b[inv + i +  1]++;
            b[inv + i +  2]++;
            b[inv + i +  3]++;
        }
    }
}

