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 printList( List a; ) 
	begin
		print( "{ " );
		while a <> null do
			print( a.value );
			a = a.next;
			if a <> null then
				print( ", " );
			end
		end
		print( " }" );
	end
void appendList( var List a; int data; ) 
	begin
		List b;
		if a == null then
			a = new List.init( data, null );
		else
			for b = a; b.next <> null; b = b.next do
			end
			b.next = new List.init( data, null );
		end
	end
List createList( []int data; ) 
	begin
		List a;
		int i;
		a = null;
		for i = 0; i < size data; i = i + 1 do
			appendList( a, data[ i ] );
		end
		return a;
	end
int i;
[]int a;
List b;
a = new []int { 1, 2, 4, 8, 16, 32 };
for i = 0; i < size a; i++ do
	println( a[ i ] );
end
b = createList( a );
printList( b );
println();
