// Arup Guha
// Written a long time ago.
// Tracing Question for Inheritance

class A {

	protected int x;

	public A() {
		System.out.println("In Default A.");
		x = 0;
	}

	public A(int val) {
		System.out.println("In A(int).");
		x = val;
	}

	public void function() {
		System.out.println("In A's function.");
	}
	
	public void functionA() {
		System.out.println("Only A has this function.");
	}
}

class B extends A {

	protected int y;

	public B() {
		System.out.println("In Default B.");
		y = 0;
	}

	public B(int val) {
		super(val);		
		System.out.println("In B(int).");
		y = val;
	}

	public void function() {
		System.out.println("In B's function.");
	}
}

public class C extends B {

	protected int z;

	public C() {
		super(5);
		System.out.println("In Default C.");
		z = 2;
	}

	public C(int val) {
		super();
		System.out.println("In C(int).");
	}
	
	public C(int one, int two, int three) {
		System.out.println("In C(int,int,int).");
		x = one;
		y = two;
		z = three;
	}
	
	public void functionA() {
		System.out.println("A lied.");
	}
	
	public static void main(String[] args) {
		A test1 = new A();
		C test2 = new C(7);
		C test3 = new C(4,6,8);
		test3.function();
		test2.functionA();
		A temp = test2;
		temp.function();
		temp.functionA();
		temp = new A();
		temp.functionA();
		B test4 = new B(5);
		test4.functionA();
	}
}
