var a,b,d:array[0..10000000] of longint;
    q,p,t,p1,n,i:longint;
  begin
   read(n,q);
   for i:=1 to q do
   begin
    read(t);
    b[i]:=t;
    if t=1 then
     begin
     read(t);
     d[i]:=t;
    end;
  end;
  p:=1;
  p1:=2;

  for i:=1 to q do
   if b[i]=2 then
    begin
    if p mod 2=1 then inc(p) else dec(p);
   end
  else
   begin
    p:=p+d[i];
    if p>n then p:=p mod n else
    if p<=0 then p:=p+n;
   end;


   for i:=1 to q do
   begin
   if b[i]=2 then
    begin
    if p1 mod 2=1 then inc(p1) else dec(p1);
   end
  else
   begin
    p1:=p1+d[i];
    if p1>n then p1:=p1 mod n else
    if p1<=0 then p1:=p1+n;

   end;
   //writeln(p1);
   end;

   //writeln(p,' ',p1);

  for i:=0 to n div 2-1 do
   if p+2*i>n then a[(p+2*i) mod n]:=2*i+1 else a[p+2*i]:=2*i+1;


   for i:=0 to n div 2-1 do
   if p1+2*i>n then a[(p1+2*i)mod n]:=2*i+2 else a[p1+2*i]:=2*i+2;

  for i:=1 to n do
  write(a[i],' ');
end.










