n = read_line.to_i xy = Array.new(n) { x, y = read_line.split.map &.to_i; {x, y} } ans = xy.each_with_index.group_by { |(x, y), i| {x % 5, y % 9} }.values.max_by(&.size).map { |(x, y), i| Tuple.new({x//5, y//9}, i) }.group_by { |(x, y), i| (x + y) % 2 }.values.max_by(&.size).map { |xy, i| i + 1 } puts ans.size, ans.join(' ')