<< "ArrowDiagramsAndLieBialgebras.m"

base = 10;

ds = BasisAArrow[4];

SaveUGL0[diag_Diag] := Module[
  {fname},
  fname = StringJoin[
    "data/UGL0For",
    ToString[FromDigits[Cases[diag, _Integer, Infinity], base]],
    ".m"
    ];
  Print["Saving ", fname, " ..."];
  Put[{diag, UGLnBiAlg0[diag]}, fname];
  ]

For[index = 1, index <= Length[ds], index++,
  Print[index, " ", ds[[index]]];
  Print[Timing[SaveUGL0[ds[[index]]]]]
  ];

Exit[]
