```
import functools
def sortOrders(orderList):
p,np = [],[]
for order in orderList:
splitted = order.split(' ',1)
if splitted[1][0].isdigit():
np.append(order)
else:
p.append([splitted[0],splitted[1]])
def compare(order1,order2):
if(order1[1] < order2[1]):
return -1
elif(order1[1] == order2[1]):
if(order1[0] < order2[0]):
return -1
return 1
p = sorted(p,key = functools.cmp_to_key(compare))
return [order[0] + ' ' + order[1] for order in p] + np
```