import Data.String

readNumber : IO (Maybe Nat)
readNumber = do
  input <- getLine
  if all isDigit (unpack input)
    then pure (Just (stringToNatOrZ input))
    else pure Nothing

readNumbers : IO (Maybe (Nat, Nat))
readNumbers = do
  Just num1_ok <- readNumber
    | Nothing => pure Nothing
  Just num2_ok <- readNumber
    | Nothing => pure Nothing
  pure (Just (num1_ok, num2_ok))
