class List
	begin
		instance
			int value;  
			List next;
			List init( int value; List next; )
				begin
					this.value = value;
					this.next = next;
					return this;
				end
	end

void buildListText( List a; var []char result; )
        begin
     		   []char result1;
                if a <> null then
                        if a.next == null then
                                result = "" + a.value;
                        else
                                buildListText( a.next, result1 );
                                result = a.value + ", " + result1;
                        end
                end
        end                

List a, a1, a3, a5;
[]char result;
a5 = new List.init( 5, null );
a3 = new List.init( 3, a5 );
a1 = new List.init( 1, a3 );
a = a1;
buildListText( a, result );
println( "{" + result + "}" );
