problem018.py : Completed