program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var pr,pr1:array[2..100000] of boolean;
    p:array[1..100000] of integer;
    n,npr,k,i,j:integer;
    p1:array[0..100000,1..2] of integer;
    z:array[1..100000] of boolean;
    ans:array[1..100000] of integer;
function CmodM(n,k,m:integer):boolean;
var np,i,j,k1,k2,x,t1,t2:integer;
    ok:boolean;
begin
   fillchar(pr1,sizeof(pr1),false);

   k1:=0; t1:=0; p1[0,1]:=0;
   for k:=1 to n do
   begin
      x:=n-k+1; k2:=k;
      i:=1; :=0;
      while i<=k1 do
      begin
         while x mod p1[i,1]=0 do
         begin
            p1[i,2]:=p1[i,2]+1;
            x:=x div p1[i,1];
         end;
         while k2 mod p1[i,1]=0 do
         begin
            p1[i,2]:=p1[i,2]-1;
            if p1[i,2]=0 then
            begin
               pr1[p1[k1,1]]:=false; k1:=k1-1; t1:=p1[i-1,1];
            end;
            k2:=k2 div p1[i,1];
         end;
         i:=i+1;
      end;
      j:=1;
      while x>1 do
      begin
         if pr[x] then
         begin
            if pr1[x] then
            begin
               i:=k1;
               while p1[i,1]<>x do
                  i:=i-1;
               p1[i,2]:=p1[i,2]+1;
               while k2 mod x=0 do
                  k2:=k2 mod x;
            end
            else
            begin
               k1:=k1+1; t1:=x;
               p1[k1,1]:=x; p1[k1,2]:=1;
               while k2 mod x=0 do
                  k2:=k2 mod x;
            end;
            x:=1;
            for i:=1 to
         end;
         if x mod p[j]=0 then
         begin
            k1:=k1+1; t1:=p[j]; p1[k1,1]:=t1; p1[k1,2]:=0;
            while x mod p[j]=0 do
            begin
               inc(p1[k1,2]); x:=x div p[j];
            end;
            while k2 mod p[j]=0 do
            begin
               dec(p1[k1,2]); k2:=k2 div p[j];
            end;
         end;
         j:=j+1;
      end;

   end;
   x:=1;
   for i:=1 to n do
      if z[i] then x:=(x*(i mod m)) mod m;

   if x=0 then CmodM:=true
   else CmodM:=false;
end;
begin
   npr:=0;
   fillchar(pr,sizeof(pr),true);
   for k:=2 to 100000 do
      if pr[k] then
      begin
         i:=k; npr:=npr+1; p[npr]:=k;
         while i<=100000 do
         begin
            pr[i]:=false;
            i:=i+k;
         end;
      end;
    for k:=1 to 1000 do
    begin
       cmodm(100000,k,234345);
    end;
  { TODO -oUser -cConsole Main : Insert code here }
end.
