#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int maxn = 100 + 10;
vector<int> a;
int s[maxn];
int main() {
  int n, k;
  while (~scanf("%d%d", &n, &k)) {
    a.clear();
    for (int i = 1; i <= n; i++) a.push_back(i);
    for (int i = 1; i <= k; i++) scanf("%d", s + i);
    int st = 1;
    for (int i = 1; i <= k; i++) {
      int step = s[i];
      step += st;
      step %= a.size();
      step = (step - 1 + a.size()) % a.size();
      printf("%d ", a[step]);
      a.erase(a.begin() + step);
      st = (step + 1) % a.size();
    }
  }
  return 0;
}
