this problem is actually how constant are initialize and how super interface are called in
JAVA, let me try to explain you :
Suppose you write :
System.out.println(B);
now see how things work:
in case when B is called first values are :
B =2, C =1, A =0
Similarly When
System.out.println(A);
so A =4,B = 2, C = 1
similarly when C is called first :
C =3,A = 2, B =1
so when you call B+C+A
you get : 2 + 1 + 0 = 3
similarly
A + B + C = 4 + 2 + 1 = 7