Solution to the translation problem (in python).