I have a long list. It is result obtained from running a python script. It is as follows
[[0, [[38], [65]]]
[0, [[39], [6]]]
[0, [[40], [67]]]
[0, [[41], [68]]]
[0, [[42], [69]]]
[1, [[43], [70]]]
[1, [[44], [71]]]
[0, [[50], [77]]]
[0, [[51], [78]]]
[0, [[52], [79]]]
[1, [[53], [80]]]
[0, [[12], [54]]]
[1, [[13], [55]]]
[1, [[14], [56]]]
[0, [[57]]]
[1, [[58]]]
[0, [[59]]]
[0, [[60]]]
[0, [[61]]]
[1, [[1, 2], [69]]]
[0, [[1], [2, 3], [70]]]
[1, [[2], [3, 4], [71]]]
[1, [[3], [4, 5], [15], [72]]]
[1, [[4], [5, 6], [16], [73]]]
[0, [[5], [6, 7], [17], [74]]]]
I am new to latex and I want to write these in a thesis as part of a result. Splitting the page does not give me desirable results as for other examples the elements get even longer and goes out of view.
Is there a dynamic technique which I can use to add such type of lists efficiently, i.e. the short elements in the same line and longer ones on the next line, without doing it for each case?
Also open for any other suggestions on how to incorporate such list.

