The rise of the Alternative for Germany has forced Germany's mainstream parties to work together in coalition to exclude the far right from power.