Do problem 89 in Erlang.