Solution by Andreas Mahnke