module P004 where
import Euler
solution :: EulerType
solution = Left $ foldl (
	\m a -> foldMaybe (
		\m b -> let c = a * b in
			if c <= m     then Nothing
			else if pal c then Just c
			else               Just m
		) m [999, (if a `divides` 11 then 998 else 988) .. a]
	) 0 [999, 998 .. 100]
main = printEuler solution
