import os

models = ["cp", "ss", "ada"]
versions = ["", "_sam", "_bsam", "_usam"]

outputs = {}
for model in models:
    for ver in versions:
        file_name = model + ver
        outputs[file_name] = []
        with open(file_name, "r") as f:
            for line in f.readlines()[-17:]:
                outputs[file_name].append(float(line))

for k in outputs.keys():
    print(k, end=",")
print()
for t in range(17):
    for v in outputs.values():
        print(f"{v[t]:.4f}", end=",")
    print()
