class A
	begin
		^char toString()
			begin
				return "A";
			end
		printf( "Init A for instance of %s\n", toString() );
		int x = 123, y = 456;
	end
class B extends A
	begin
		^char toString()
			begin
				return "B";
			end
		printf( "Init B for instance of %s\n", toString() );
		int z = 789;
	end

B b;
^A a = b;
printf( "x = %d, y = %d, z = %d\n", b.x, b.y, b.z );
printf( "a.toString() = %s\n", a.toString() );
