made a python script for this:

tickets = [

['1EPd8DM5vQ3UvQY6Yr4bcYk13a4XsBnwz3', 5],

['1EnvHJgQh7WGPpnL686RDQFW6FEeznTbkB', 10],

['1tqwh6iBYk7F7gcVQ7PKuamf1PR4QgbgF', 20],

['1HvsWwqqtc775XM2iYHjAoekpzH3dptVNr', 41],

['1JosHcP8sVeBCdonMDSaZfS6cb9Ub46cmJ', 40],

['1FZ8tW5wjh1EDFsztSQYtpkxsa1C79GvZX', 125],

['1DpL7b8XBE7N2FecL6GGMtSRVUyBKC6Rd3', 251],

['16Uox1JKSqfe5LpWpm5TVVqdCcqBiybfgP', 5],

['19xRS9cz3m8YXnf83eWe2vHRL1skgixJre', 20],

['1FdtJayHR5qWJ67RAhGDjgedVKjFSHSKad', 75],

['1BUN1vb6r6fz1peafNrptCtMuRwVq8aNKo', 5],

['1AiqDfTWsT2wiu9JqgFJaCYpJZ5XBMGRPy', 50],

['12DnFV5JeeD8oBeVd17hkqZCaAnKzWeoNp', 15],

['17r7ALUqoKQ3d8MpQ8QBTfqiEoQMiztRDh', 20],

['1HvsWwqqtc775XM2iYHjAoekpzH3dptVNr', 50],

['1QKVV9BHmZNJkMCUNyssYX1BimzXZ72dQP', 125],

['1NV8i5tQGysjogJZcZ2mAQkf6NsT4ccw2Q', 100],

['19oR5xAYaASPtPxgaV3BuQTCn7Dh9Wrzqw', 40]

]

result = []

total = 0

wanted = tickets[0][1] * 2

index = 0

for i in range(1,len(tickets)):

total += tickets[i][1]

if (total >= wanted):

print (tickets[index][0], wanted)

total = total-wanted

index = index +1

wanted = tickets[index][1] * 2