Solution of #45.