<< "ArrowDiagramsAndLieBialgebras.m"

base = 10;

ds = BasisAArrow[4];

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

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

Exit[]
