#include <bits/stdc++.h>
using namespace std;
int n, m, d[110], tot, iter;
bool used[110];
int main() {
  memset(used, false, sizeof(used));
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) scanf("%d", &d[i]);
  tot = n;
  iter = 1;
  for (int i = 0; i < m; i++) {
    int dis = d[i] % tot;
    for (int i = 0; i < dis; i++) {
      iter++;
      if (iter > n) iter -= n;
      while (used[iter]) {
        iter++;
        if (iter > n) iter -= n;
      }
    }
    printf("%d ", iter);
    used[iter] = true;
    iter++;
    if (iter > n) iter -= n;
    while (used[iter]) {
      iter++;
      if (iter > n) iter -= n;
    }
    tot--;
  }
  printf("\n");
  return 0;
}
