Outgoing Japanese monarch pays respects to gods