// nejprve poskladame kosinovou cast
  for i:=0 to Length(params.t) - 1 do begin
    if StopSolu then Exit;
    for j := 0 to Length(params.multiplik) - 1 do begin
      s:=WorkDir+'CTemp'+IntToStr(i*Length(params.multiplik)+j)+'.mtx';
      if FileExists(s) then begin
        assignfile(f1,s);
        reset(f1);
        k:=0;
        while not eof(f1) do begin
          readln(f1,s);
          k:=k+1;
          if (pos('%',s)=0) and (k>4) then begin   // na ctvrtem radku je velikost matice - ta nas nezajima
            s1:=copy(s,1,pos(' ',s)-1); //nactu radkovy index
            i1:=StrToInt(s1);
            delete(s,1,pos(' ',s));
            s1:=copy(s,1,pos(' ',s)-1); //nactu sloupcovy index
            i2:=StrToInt(s1);
            delete(s,1,pos(' ',s));
            i1:=i1+i*cards;            //posun na danou pozici - radkovy index
            i2:=i2+j*cards;            //posun na danou pozici - sloupcovy index
            s:=IntToStr(i1)+' '+IntToStr(i2)+' '+s;
            Memo.Add(s);
          end;
        end;
        closefile(f1);
        DeleteFile(WorkDir+'CTemp'+IntToStr(i*Length(params.multiplik)+j)+'.mtx');
      end;
    end;
  end;

  // nasledne poskladame sinovou cast
  for i:=0 to Length(params.t) - 1 do begin
    if StopSolu then Exit;
    for j := 0 to Length(params.multiplik) - 1 do begin
      s:=WorkDir+'STemp'+IntToStr(i*Length(params.multiplik)+j)+'.mtx';
      if FileExists(s) then begin
        assignfile(f1,s);
        reset(f1);
        k:=0;
        while not eof(f1) do begin
          readln(f1,s);
          k:=k+1;
          if (pos('%',s)=0) and (k>4) then begin   // na ctvrtem radku je velikost matice - ta nas nezajima
            s1:=copy(s,1,pos(' ',s)-1); //nactu radkovy index
            i1:=StrToInt(s1);
            delete(s,1,pos(' ',s));
            s1:=copy(s,1,pos(' ',s)-1); //nactu sloupcovy index
            i2:=StrToInt(s1);
            delete(s,1,pos(' ',s));
            i1:=i1+i*cards+Length(params.t)*cards;            //posun na danou pozici - radkovy index
            i2:=i2+j*cards+Length(params.multiplik)*cards;    //posun na danou pozici - sloupcovy index
            s:=IntToStr(i1)+' '+IntToStr(i2)+' '+s;
            Memo.Add(s);
          end;
        end;
        closefile(f1);
        DeleteFile(WorkDir+'STemp'+IntToStr(i*Length(params.multiplik)+j)+'.mtx');
      end;
    end;
  end;