unittest
{
	assert( [ "3", "1 0 0" ].parse.expand.solve == "1\n1" );
	assert( [ "5", "0 0 0 0 0" ].parse.expand.solve == "0" );
}



import std.conv;
import std.format;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	input.popFront;
	auto as = input.front.split.to!( long[] );
	return tuple( as );
}

auto solve( long[] as )
{
	long[] anss;
	auto bs = new long[ as.length ];
	auto bc = 0L;
	for( auto i = as.length.signed; 0 < i; i-- )
	{
		auto bt = 0L;
		for( auto d = 1L; i * d <= as.length; d++ )
		{
			bt += bs[ i * d - 1 ];
		}
		if( bt % 2 == as[ i - 1 ] ) continue;
		bs[ i - 1 ] = 1;
		anss ~= i;
	}
	if( anss.length == 0 ) return format( "%s", anss.length );
	else                   return format( "%s\n%s", anss.length, anss.to!( string[] ).join( " " ) );
}
