I have two lists and wish to generate a combination with the following criteria:

```
a = [1,7,12,50,51,52,57,59,60,61,67,96,59,58] 
b = [1,2,3,...200]

combination_a = [(p,q,r) for p in a for q in a for r in a]

combination_b = [(p,q,r) for p in b for q in b for r in b
                          if (p,q,r) not in combination_a]
print (combination_b)

```

How should I sort out memory issues with the program when handling large quantities of data and how should I get the output in excel? 

```
import xlsxwriter workbook = xlsxwriter.Workbook('Sample.xlsx', {'constant_memory': True}) 
worksheet = workbook.add_worksheet() 

row = 0 

for row, group in enumerate (combo): 
  for col in range(3): 
    worksheet.write (row, col, group[col]) 

workbook.close()

```