{-
  ?????¨?????? 30 ?????????????????? Data.Map ?????£??¨?????°????????£??????
-}
import Control.Monad
import Data.List
import qualified Data.Map as M

main :: IO ()
main = do
  d <- readLn
  when (d /= 0) $ do
    vs <- replicateM (d+3) readLn
    print $ head $ filter (outlier d $ M.fromList $ zip [0..] vs) [0..d+2]
    main
  
lerp :: M.Map Int Double -> Int -> Double
lerp vs x = sum $ zipWith (*) (map (\i -> mkCoef i (fromIntegral x) / mkCoef i (fromIntegral i)) $ M.keys vs) $ M.elems vs
  where
    mkCoef i y = product $ map ((y-) . fromIntegral) $ delete i $ M.keys vs

outlier :: Int -> M.Map Int Double -> Int -> Bool
outlier d vs e = all f $ delete e [0..d+2]
  where
    f i = abs (lerp xs i - vs M.! i) < 0.1
      where
        xs = M.delete i $ M.delete e vs