Program divisor;
var
A, B, G, K, T, i,test,radq, somma, contadivisori : LongInt;
divis1, divis2:array[1..100000] of longint;
procedure trovadivisori (x:longint);
var y,h:longint;
begin
y:=2; h:=2;
repeat
if (x mod y =0) then begin divis1[h]:= x div y; divis2[h]:=y; h:=h+1; end;
y:=y+1;
until y>trunc(sqrt(x));
contadivisori:=h-1;
end;
begin
{ assign(input, 'input.txt'); reset(input);
assign(output, 'output.txt'); rewrite(output);
}
ReadLn(T);
for test:=1 to T do begin
ReadLn(A, B, K);
somma:=A+B+K;
radq:=trunc(sqrt(somma));
divis2[1]:=1; divis1[1]:=somma;
trovadivisori(somma);
for i:=1 to contadivisori do write (divis2[i],' '); writeln;
for i:=1 to contadivisori do write (divis1[i],' '); writeln;
G := 0;
end;
writeln(G);
end.
UHJvZ3JhbSBkaXZpc29yOwoKdmFyCiAgICBBLCBCLCBHLCBLLCBULCBpLHRlc3QscmFkcSwgc29tbWEsIGNvbnRhZGl2aXNvcmkgOiBMb25nSW50OwogICAgZGl2aXMxLCBkaXZpczI6YXJyYXlbMS4uMTAwMDAwXSBvZiBsb25naW50OwogICAgCnByb2NlZHVyZSB0cm92YWRpdmlzb3JpICh4OmxvbmdpbnQpOwp2YXIgeSxoOmxvbmdpbnQ7CiAgICAKYmVnaW4KICAgeTo9MjsgaDo9MjsKICAgcmVwZWF0CiAgIAkgICAgaWYgICh4IG1vZCB5ID0wKSB0aGVuIGJlZ2luIGRpdmlzMVtoXTo9IHggZGl2IHk7IGRpdmlzMltoXTo9eTsgaDo9aCsxOyBlbmQ7CiAgIAkgICAgeTo9eSsxOwogIHVudGlsIHk+dHJ1bmMoc3FydCh4KSk7CiAgY29udGFkaXZpc29yaTo9aC0xOwplbmQ7CgpiZWdpbgp7ICAgYXNzaWduKGlucHV0LCAgJ2lucHV0LnR4dCcpOyAgcmVzZXQoaW5wdXQpOwogICAgYXNzaWduKG91dHB1dCwgJ291dHB1dC50eHQnKTsgcmV3cml0ZShvdXRwdXQpOwp9CgogIC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