Solution of #51.