moving average cost calculation

From the ax white paper example,

We receipt 2 item and sell 1 item.

After that we post invoice for the receipt, the invoice will include the selling item for sure.

What if we have another scenario, we have another receipt

Oct, 2 receipt 1

Oct, 3 receipt 2

Oct, 5 sell -1

How can we know what is the item that we sell ? Is it FIFO ?