int z;

class A
	begin
		int w, x, y;
		[ 100 ]char result;
		void setWXY( int w, x, y; )
			begin
				this.w = w;
				this.x = x;
				this.y = y;
			end
		^char toString()
			begin
				sprintf( result, 
					"class A: w = %d, x = %d, y = %d", w, x, y );
				return result;
			end
	end

class B extends A
	begin
		int p, q;
		void setPQ( int p, q; )
			begin
				this.p = p;
				this.q = q;
			end
		^char toString()
			begin
				sprintf( result, 
					"class B: p = %d, q = %d, w = %d, x = %d, y = %d", 
					p, q, w, x, y );
				return result;
			end
	end

B b;
b.setPQ( 111, 222 );
b.setWXY( 333, 444, 555 );
^A a = b;
printf( "a = %s\n", a.toString() );
