with open("group_order.txt", "r") as f:
    data = f.read()

types = data.split(", ")

PREFIX = "RT_"
GROUPING = 6
out = ""
line = []
for i, t in enumerate(types):
    line += [f"{PREFIX}{t}"]
    if (i + 1) % GROUPING == 0:
        out += ", ".join(line) + ",\n"
        line = []

# leftover
if line:
    out += ", ".join(line) + ",\n"

print(out)
