n = gets.to_i
a = gets.split.map(&:to_i)
mask = a[0] == 0 ? 0 : a[1..-1].map {|i| 1 << i }.inject(:|) 
(0..2**n-1).each do |b|
  puts ("#{b}: " + (0..n-1).select {|i| b[i] == 1 } * ' ').strip if b & mask == mask
end

