Little Artem is fond of dancing. Most of all dances Artem likes rueda — Cuban dance that is danced by pairs of boys and girls forming a circle and dancing together.

More detailed, there are *n* pairs of boys and girls standing in a circle. Initially, boy number 1 dances with a girl number 1, boy number 2 dances with a girl number 2 and so on. Girls are numbered in the clockwise order. During the dance different moves are announced and all pairs perform this moves. While performing moves boys move along the circle, while girls always stay at their initial position. For the purpose of this problem we consider two different types of moves:
 1.  Value *x* and some direction are announced, and all boys move *x* positions in the corresponding direction. 1.  Boys dancing with even-indexed girls swap positions with boys who are dancing with odd-indexed girls. That is the one who was dancing with the girl 1 swaps with the one who was dancing with the girl number 2, while the one who was dancing with girl number 3 swaps with the one who was dancing with the girl number 4 and so one. It's guaranteed that *n* is even. 
Your task is to determine the final position of each boy.
The first line of the input contains two integers *n* and *q* (2 ≤ *n* ≤ 1 000 000, 1 ≤ *q* ≤ 2 000 000) — the number of couples in the rueda and the number of commands to perform, respectively. It's guaranteed that *n* is even.

Next *q* lines contain the descriptions of the commands. Each command has type as the integer 1 or 2 first. Command of the first type is given as *x* ( - *n* ≤ *x* ≤ *n*), where 0 ≤ *x* ≤ *n* means all boys moves *x* girls in clockwise direction, while  - *x* means all boys move *x* positions in counter-clockwise direction. There is no other input for commands of the second type.
none
6 3
1 2
2
1 2
4 3 6 5 2 1
2 3
1 1
2
1 -2
1 2
4 2
2
1 3
1 4 3 2
6 8
1 2
2
2
2
2
1 1
1 -5
2
4 3 6 5 2 1
6 8
1 -1
2
2
1 4
1 0
1 -1
1 0
1 -1
6 1 2 3 4 5
10 5
1 8
1 -3
1 -3
2
1 5
3 6 5 8 7 10 9 2 1 4
10 10
1 2
1 -10
1 -5
2
2
1 -4
2
2
1 -10
1 -9
7 8 9 10 1 2 3 4 5 6
6 9
2
1 -2
2
1 -6
1 -6
1 4
2
1 -1
2
2 5 4 1 6 3
2 5
2
1 -1
2
1 1
2
2 1
2 8
2
2
2
1 -2
1 -1
1 -1
2
1 1
2 1
36 86
1 -25
2
2
2
1 16
1 -14
1 12
2
1 -21
2
1 -12
1 34
1 -4
1 19
1 5
2
2
2
2
1 -1
1 -31
2
1 -6
1 1
2
2
1 27
1 19
2
1 -14
2
1 -17
2
2
2
2
1 -35
1 -31
1 7
2
2
2
1 -12
2
2
2
2
1 7
1 -9
1 -2
2
1 -3
2
2
1 33
1 -8
1 -17
1 2
2
1 -29
1 -19
2
1 22
2
2
2
2
1 -15
1 7
1 -29
2
2
1 -30
2
2
1 -6
2
1 -25
2
1 -18
2
1 33
1 23
2
2
2
25 22 27 24 29 26 31 28 33 30 35 32 1 34 3 36 5 2 7 4 9 6 11 8 13 10 15 12 17 14 19 16 21 18 23 20
10 71
1 -4
1 -3
2
2
2
1 -3
1 4
2
2
2
2
1 5
2
2
2
2
2
1 1
2
1 2
1 1
2
1 -5
2
2
2
2
1 8
1 -9
1 -3
1 2
1 3
1 -2
1 -6
2
2
1 -2
2
1 -6
1 5
1 2
1 -10
1 3
2
1 6
2
2
1 4
1 -8
1 -4
1 -1
2
2
1 1
2
2
1 3
1 8
1 7
1 4
2
1 -10
2
2
1 5
1 9
1 -5
2
2
1 -2
2
1 2 3 4 5 6 7 8 9 10
74 85
2
1 -69
2
2
2
2
2
1 74
2
2
1 -41
2
2
1 15
2
2
2
1 -12
2
1 -3
1 28
1 -46
2
1 -39
2
1 6
2
2
1 -30
2
1 16
1 30
1 -50
1 -17
1 41
1 56
2
1 -45
1 -21
1 63
1 -7
2
1 -6
1 26
2
1 -71
2
2
2
1 11
2
1 70
1 13
2
1 -51
1 -9
1 -72
1 55
2
1 3
2
2
1 47
2
2
2
1 -6
1 -37
2
2
1 -1
1 72
2
1 -23
2
2
2
1 70
1 38
2
2
1 74
1 -1
2
1 -9
71 18 73 20 1 22 3 24 5 26 7 28 9 30 11 32 13 34 15 36 17 38 19 40 21 42 23 44 25 46 27 48 29 50 31 52 33 54 35 56 37 58 39 60 41 62 43 64 45 66 47 68 49 70 51 72 53 74 55 2 57 4 59 6 61 8 63 10 65 12 67 14 69 16
24 8
1 17
2
1 -10
2
2
2
2
1 19
22 1 24 3 2 5 4 7 6 9 8 11 10 13 12 15 14 17 16 19 18 21 20 23
242 11
1 -202
1 46
2
1 -144
2
1 134
1 104
2
1 -32
2
1 36
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 ...
364 57
1 -101
1 110
1 -76
1 329
2
2
2
1 -191
1 97
1 189
1 305
1 -313
1 312
1 -148
2
1 -104
1 85
1 -55
1 -79
1 230
1 -94
1 58
1 -72
2
2
2
1 -104
1 -351
1 23
2
1 215
2
2
2
1 58
1 -237
2
2
2
1 198
2
1 83
2
1 -205
2
2
2
2
1 -110
2
2
2
2
1 153
1 -344
1 -281
1 -159
218 215 220 217 222 219 224 221 226 223 228 225 230 227 232 229 234 231 236 233 238 235 240 237 242 239 244 241 246 243 248 245 250 247 252 249 254 251 256 253 258 255 260 257 262 259 264 261 266 263 268 265 270 267 272 269 274 271 276 273 278 275 280 277 282 279 284 281 286 283 288 285 290 287 292 289 294 291 296 293 298 295 300 297 302 299 304 301 306 303 308 305 310 307 312 309 314 311 316 313 318 315 320 317 322 319 324 321 326 323 328 325 330 327 332 329 334 331 336 333 338 335 340 337 342 339 344 341...
6 5
1 5
1 5
1 6
1 6
1 6
3 4 5 6 1 2
import sys
import math
import itertools as it
import operator as op
import fractions as fr


n,q = map(int, sys.stdin.readline().split())
C = [[1, 0]]

for _ in range(q):
  L = list(map(int, sys.stdin.readline().split()))

  if L[0] == 1:
    C[-1][1] += L[1]
    C[-1][1] %= n
  else:
    if len(C) == 1:
      C.append([2])
      C.append([1, 0])
    else:
      C[0][1] += C[-1][1]
      C[0][1] %= n
      if C[-1][1] % 2 == 0:
        C.pop()
        C.pop()
      else:
        C[-1][1] = n/2

R = [i+1 for i in range(n)]
if len(C) > 0:
  d = C[0][1]
  R = R[n-d:] + R[:n-d]

if len(C) > 1:
  for i in range(n//2):
    R[2*i],R[2*i+1] = R[2*i+1],R[2*i]

if len(C) > 2:
  d = C[-1][1]
  R = R[n-d:] + R[:n-d]

print(' '.join(map(str,R)))

