n=int(input())

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

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

    k=int(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:]

print(*c,sep='\n')

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)

n = int(input())
c = list(range(1, 1 + 2 * n))
for _ in [0] * int(input()):
    k = int(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 :]
print(*c, sep="\n")

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)

-n = int(input()) +n = int(eval(input())) -for _ in [0] * int(input()): -    k = int(input()) +for _ in [0] * int(eval(input())): +    k = int(eval(input())) -print(*c, sep="\n") +for x in c: +    print(x)