/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	
	private static int compare(BitSet lhs, BitSet rhs) {
        if (lhs.equals(rhs)) return 0;
        BitSet xor = (BitSet)lhs.clone();
        xor.xor(rhs);
        int firstDifferent = xor.length()-1;
        return rhs.get(firstDifferent) ? 1 : -1;
    }
	public static void main (String[] args) throws java.lang.Exception
	{
		BitSet a = new BitSet();
		BitSet b = new BitSet();
		BitSet c = new BitSet();
		a.set(5);
		b.set(500);
		c.set(73);
		System.out.println("a ? a = "+compare(a,a));
		System.out.println("a ? b = "+compare(a,b));
		System.out.println("a ? c = "+compare(a,c));
		System.out.println("b ? a = "+compare(b,a));
		System.out.println("b ? b = "+compare(b,b));
		System.out.println("b ? c = "+compare(b,c));
		System.out.println("c ? a = "+compare(c,a));
		System.out.println("c ? b = "+compare(c,b));
		System.out.println("c ? c = "+compare(c,c));
	}
}