public class TestContraVariant {
    main(x, y) {
    	var y2 = m(x, y);
    	var y3 = y2.snd();
		var z;
		y3 = z;
		return new Pair<>(x, z);
    }

    m(x, y) {
    	var x2 = main(x, y);
    	var x3 = x2.fst();
	    var z;
		x3 = z;
        return new Pair<>(z, y);
    }
}

class Pair<T, U> {
    public T x;
    public U y;

    public Pair() {
    }

    public Pair(T var1, U var2) {
        x = var1;
        y = var2;
    }

    public T fst() {
        return x;
    }

    public U snd() {
        return y;
    }
}