#include <bits/stdc++.h>
using namespace std;
const int maxn = 110;
bool vs[maxn];
int main() {
  int n, k;
  bool first = 1;
  int sum;
  scanf("%d%d", &n, &k);
  sum = n;
  memset(vs, 1, sizeof vs);
  int now = 0, t;
  for (int i = 0; i < k; i++) {
    scanf("%d", &t);
    for (int j = 0; j < t % sum; j++) {
      now = (now + 1) % n;
      while (vs[now] == 0) now = (now + 1) % n;
    }
    vs[now] = 0;
    sum--;
    if (first) {
      first = 0;
      printf("%d", now + 1);
    } else
      printf(" %d", now + 1);
    while (vs[now] == 0) now = (now + 1) % n;
  }
  return 0;
}
