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, (x//5 + y//9) % 2} }.values.max_by(&.size).map { |xy, i| i + 1 } puts ans.size, ans.join(' ')