Solution of #49.