public static void main(String[] args) {
        BigInteger secwet = new BigInteger("1234");
        System.out.println("in: " + secwet.toString(2));
        System.out.println();

        int bitlen = secwet.bitLength();
        bitlen += 3;
        int k = 3, k2 = 3;

        SecretSend s = new SecretSend(secwet, k, bitlen);
        SecretReceive r = new SecretReceive(k);

        while(true) {
            for(int i = 0; i < Math.pow(2, k); i++) {
                int y = s.y();
                r.notY(y);
            }

            if(k2 == bitlen)
                break;

            System.out.println("next round: " + k2);

            System.out.print("receive: ");
            for(int i = 0; i < r.arr.length; i++) {
                if(r.arr[i] == null)
                    System.out.print("NULL, ");
                else
                    System.out.print(r.arr[i].toString(2) + ", ");
            }
            System.out.println();

            System.out.print("send: ");
            for(int i = 0; i < s.arr.length; i++) {
                if(s.arr[i] == null)
                    System.out.print("NULL, ");
                else {
                    if(s.cur == i)
                        System.out.print("[" + s.arr[i].toString(2) + "], ");
                    else
                        System.out.print(s.arr[i].toString(2) + ", ");
                }
            }
            System.out.println();

            s.nextRound();
            r.nextRound();


            k2 += 1;
        }

        System.out.println("giving " + (int) (Math.pow(2, k)-1) + " additional bits...");
        for(int i = 0; i < Math.pow(2, k)-1; i++) {
            int y = s.yOverride();
            r.notY(y);
        }

        System.out.println();
        System.out.println("done! last element left: " + r.solve().toString(2));

    }