#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9 + 10;
int read() {
  int xx = 0, ww = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') ww = -ww;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    xx = 10 * xx + ch - 48;
    ch = getchar();
  }
  return xx * ww;
}
int n, k;
struct Node {
  int id;
  int nxt, pre;
} a[1010], cnt;
int main() {
  n = read();
  k = read();
  a[0].nxt = a[0].id = a[0].pre = 0;
  for (int i = 1; i < n; i++) {
    a[i].id = i;
    a[i].pre = a[0].pre;
    a[0].pre = i;
    a[i].nxt = 0;
    a[a[i].pre].nxt = i;
  }
  int x;
  cnt = a[0];
  for (int i = 0; i < k; i++) {
    x = read();
    x %= (n - i);
    while (x--) cnt = a[cnt.nxt];
    printf("%d ", cnt.id + 1);
    a[cnt.pre].nxt = cnt.nxt;
    a[cnt.nxt].pre = cnt.pre;
    cnt = a[a[cnt.id].nxt];
  }
  puts("");
  return 0;
}
