gets;
a=[0,*gets.split.map(&:to_i)]
b=[0]*a.size
(1...a.size).reverse_each.each{|i|
    r = b.each_slice(i).map(&:first).reduce(:^) ^ a[i]
    b[i]=r
}

print b.count(1),"\n"
(0...b.size).each{|i|
    print i,"\n" if b[i] ==1
    }