class A
	begin
		int x, y;
		void f( int p; )
			begin
				print( "A.f()\n" );
				x = p;
			end
		void g( int q; )
			begin
				print( "A.g()\n" );
				y = q;
			end
		void printA()
			begin
				printf( "x = %d, y = %d\n", x, y );
			end
	end
	
class B extends A
	begin
		int z;  
		void f( int p; )
			begin
				print( "B.f()\n" );
				x = p;
			end
		void h( int r; )
			begin
				print( "B.h()\n" );
				z = r;
			end
		void printA()
			begin
				printf( "x = %d, y = %d, z = %d\n", x, y, z );
			end
	end

B b;
^A a = b;

b.f( 444 );
b.g( 555 );
b.h( 666 );

b.printA();

a.f( 111 );
a.g( 222 );

a.printA();
b.printA();
