defmodule Main do def main do IO.gets("") |> String.trim |> String.codepoints |> Enum.map(&Main.updowncase(&1)) |> IO.puts end def updowncase(char) do if String.match?(char, ~r/[a-z]/) do String.upcase(char) else String.downcase(char) end end end