def f(a, t)
    s = 0
    xs = a.map(&:first)
    a.each do |x, y|
        s += y * (xs - [x]).map{|u| (t - u).to_f / (x - u)}.inject(:*)
    end
    s
end

loop do
    d = gets.to_i   
    break if d == 0
    points = (0..d+2).map {|x| [x, gets.to_f]}
    
    (0..d+2).each do |i|
        a = points.dup
        a.delete_at(i)
        x_c, y_c = a.pop
        d = (y_c - f(a, x_c)).abs
        if  d < 0.0001
            puts i
            break
        end
    end     
end 