import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;

void main()
{
	auto n = readln.chomp.to!int * 2;
	auto cards = iota(1, n+1).array;
	auto m = readln.chomp.to!int;
	while (m--) {
		auto t = readln.chomp.to!int;
		if (t == 0) {
			auto tmp = cards.dup;
			foreach (i; iota(0, n, 2)) {
				tmp[i] = cards[i/2];
				tmp[i+1] = cards[(i+n)/2];
			}
			cards = tmp;
		} else {
				cards = cards[t..$] ~ cards[0..t];
		}
	}
	cards.map!(to!string).join("\n").writeln;
}