If the system decides, it is usually the transaction with the biggest loss (or the smallest profit). In fact, the first flat is the same, there is no difference (in profit and loss), don't care too much. Sometimes the system won't do what you ask, it will choose the list with the biggest loss to close the position.