p038 solved by guruma.