#include <bits/stdc++.h>
using namespace std;
int n, k;
int a[105];
map<int, bool> q;
int main() {
  while (~scanf("%d %d", &n, &k)) {
    q.clear();
    for (int i = 0; i < k; i++) scanf("%d", &a[i]);
    int t = 1;
    int t2 = n;
    for (int i = 0; i < k; i++) {
      int t3 = (a[i] %= t2);
      while (t3--) {
        t++;
        if (t > n) t = 1;
        if (q[t]) t3++;
      }
      printf("%d%c", t, i == k - 1 ? '\n' : ' ');
      q[t] = 1;
      t++;
      if (t > n) t = 1;
      while (q[t]) {
        t++;
        if (t > n) t = 1;
      }
      t2--;
    }
  }
  return 0;
}
