#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e2 + 5;
vector<int> v[MAX];
int main() {
  int n, k, i, x, pre = 1, n1;
  scanf("%d %d", &n, &k);
  n1 = n;
  bool vis[MAX];
  memset(vis, false, sizeof(vis));
  for (i = 1; i <= k; i++) {
    scanf("%d", &x);
    x %= n;
    int val = pre;
    while (x > 0) {
      val = (val + 1) % n1;
      if (!vis[val]) x--;
    }
    if (!val)
      printf("%d ", n1);
    else
      printf("%d ", val);
    vis[val] = true;
    pre = (val + 1) % n1;
    while (vis[pre]) pre = (pre + 1) % n1;
    n--;
  }
  printf("\n");
  return 0;
}
