class List( int value;  List next; );

void printList( List a; ) {
	print( "{ " );
	while ( a != null ) {
		print( a.value );
		a = a.next;
		if ( a != null )
			print( ", " );
		}
	print( " }" );
	}
	
void appendList( var List a; int data; ) {
	List b;
	if ( a == null )
		a = new List { data, null };
	else {
		for ( b = a; b.next != null; b = b.next ) {
			}
		b.next = new List { data, null };
		}
	}
	
List createList( []int data; ) {
	List a = null;
	for ( int i = 0; i < size data; i++ )
		appendList( a, data[ i ] );
	return a;
	}
	
[]int a = new []int { 1, 2, 4, 8, 16, 32 };
for ( int i = 0; i < size a; i++ )
	println( a[ i ] );
List b = createList( a );
printList( b );
println( "" );
