main :: IO ()
main = do
  [d, n] <- map read . words <$> getLine
  print $ solve d n

solve :: Int -> Int -> Int
solve d n = head $ drop (n-1) $ filter (\i -> divCnt i == d) [1..]
  where
    divCnt i
      | r == 0 = 1 + divCnt q
      | otherwise = 0
      where (q, r) = i `divMod` 100