Amazon Posts an Unexpected Profit, and its Shares Soar