when deadlock occurs in sql server, which of transactions will be aborted. I mean what's the plan of sql server to decide which of transactions should be killed!

consider the two transaction below

**Transaction A**

```
begin transaction
    update Customers set LastName = 'Kharazmi'
    waitfor delay '00:00:5'; -- waits for 5 second
    update Orders set OrderId=13
commit transaction

```

**Transaction B**

```
begin transaction
    update Orders set OrderId=14
    waitfor delay '00:00:5'; -- waits for 5 second
    update Customers set LastName = 'EbneSina'
commit transaction

```

if both transaction are executed at the same time, transaction **A** locks and updates *Customers* table whereas transaction **B** locks and updates *Orders* table. After a delay of 5 second, transaction **A** looks for the lock on *Orders* table which is already held by transaction **B** and transaction **B** looks for the lock on *Customers* table which is already held by transaction **A**. So both the transactions can not proceed further, the deadlock occurs.
my question is that, when deadlock occurs, which of the both transaction will be aborted. 
first, i executes transaction **A** then transaction B, sql server aborts transaction **A** and then first executes transaction **B** then **A** the result is the same and transaction A is alorted again. it confused me!
thanks for any help.