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.
dmFyIGEsYixkOmFycmF5WzAuLjEwMDAwMDAwXSBvZiBsb25naW50OwogICAgcSxwLHQscDEsbixpOmxvbmdpbnQ7CiAgYmVnaW4KICAgcmVhZChuLHEpOwogICBmb3IgaTo9MSB0byBxIGRvCiAgIGJlZ2luCiAgICByZWFkKHQpOwogICAgYltpXTo9dDsKICAgIGlmIHQ9MSB0aGVuCiAgICAgYmVnaW4KICAgICByZWFkKHQpOwogICAgIGRbaV06PXQ7CiAgICBlbmQ7CiAgZW5kOwogIHA6PTE7CiAgcDE6PTI7CgogIGZvciBpOj0xIHRvIHEgZG8KICAgaWYgYltpXT0yIHRoZW4KICAgIGJlZ2luCiAgICBpZiBwIG1vZCAyPTEgdGhlbiBpbmMocCkgZWxzZSBkZWMocCk7CiAgIGVuZAogIGVsc2UKICAgYmVnaW4KICAgIHA6PXArZFtpXTsKICAgIGlmIHA+biB0aGVuIHA6PXAgbW9kIG4gZWxzZQogICAgaWYgcDw9MCB0aGVuIHA6PXArbjsKICAgZW5kOw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