private int mix(int A, int B) {
        int sizeA = (A>0)?(int)Math.log10(A)+1:1;
        int sizeB = (B>0)?(int)Math.log10(B)+1:1;

        int newSize = sizeA+sizeB;

        int newA = 0;

        while (sizeA>0 || sizeB>0){
            if (sizeA>0){
                newSize--;
                sizeA--;
                int times = (int) Math.pow(10, sizeA);
                newA += A/times * Math.pow(10, newSize);
                A = A%times;
            }
            if (sizeB>0){
                newSize--;
                sizeB--;
                int times = (int) Math.pow(10, sizeB);
                newA += B/times * Math.pow(10, newSize);
                B = B%times;
            }

        }

        System.out.println(newA);

        return 0;
    }