using System; class A { public int x = 0; public void f () { Console.WriteLine ( "A:f" ); } } class B : A { public int x = 1; public void f () { Console.WriteLine ( "B:f" ); } } public class Program { public static void Main ( String [] args ) { A a = new A (); B b = new B (); A ab = new B (); a.f(); b.f(); ab.f(); Console.WriteLine ( a.x ); Console.WriteLine ( b.x ); Console.WriteLine ( ab.x ); } }