n=int(eval(input()))

c=list(range(1,1+2*n))

for _ in[0]*int(eval(input())):

    k=int(eval(input()))

    if k:c=c[k:]+c[:k]

    else:

        for a,b in zip(c[:n],c[n:]):

            c+=[a,b]

        c=c[2*n:]

for x in c:print(x)

from itertools import chain

n=int(eval(input()))

c=list(range(1,1+2*n))

for _ in[0]*int(eval(input())):

    k=int(eval(input()))

    c=c[k:]+c[:k]if k else list(chain.from_iterable(x for x in zip(c[:n],c[n:])))

for x in c:print(x)

n = int(eval(input()))
c = list(range(1, 1 + 2 * n))
for _ in [0] * int(eval(input())):
    k = int(eval(input()))
    if k:
        c = c[k:] + c[:k]
    else:
        for a, b in zip(c[:n], c[n:]):
            c += [a, b]
        c = c[2 * n :]
for x in c:
    print(x)

from itertools import chain

n = int(eval(input()))
c = list(range(1, 1 + 2 * n))
for _ in [0] * int(eval(input())):
    k = int(eval(input()))
    c = c[k:] + c[:k] if k else list(chain.from_iterable(x for x in zip(c[:n], c[n:])))
for x in c:
    print(x)

+from itertools import chain + -    if k: -        c = c[k:] + c[:k] -    else: -        for a, b in zip(c[:n], c[n:]): -            c += [a, b] -        c = c[2 * n :] +    c = c[k:] + c[:k] if k else list(chain.from_iterable(x for x in zip(c[:n], c[n:])))