import Data.Set (Set, fromList, member)

gaps :: [Int]
gaps = dropWhile (`member` mcNuggets) [100,99 .. 1]

mcNuggets :: Set Int
mcNuggets =
  let size = enumFromTo 0 . quot 100
  in fromList $
     size 6 >>=
     \x ->
        size 9 >>=
        \y ->
           size 20 >>=
           \z ->
              let v = sum [6 * x, 9 * y, 20 * z]
              in [ v
                 | 101 > v ]

main :: IO ()
main =
  print $
  case gaps of
    x:_ -> show x
    []  -> "No unreachable quantities found ..."