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

n=int(eval(input()))

c=list(range(2*n))

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

    k=int(eval(input()))

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

for x in c:print((x+1))

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

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

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