If the same purchase and sale transactions are recorded using both periodic and perpetual inventory valuation, which method will provide the same ending inventory and value of COGS under both periodic and perpetual inventory valuation?