#include <bits/stdc++.h>
using namespace std;
const int MAX_K = 105;
int step[MAX_K];
int pos[MAX_K];
vector<int> res;
int main(void) {
  int n, k;
  scanf(" %d %d", &n, &k);
  for (int i = 0; i < n; i++) {
    pos[i] = i + 1;
  }
  for (int i = 0; i < k; i++) {
    scanf(" %d", &step[i]);
  }
  int start = 0;
  int m = n;
  for (int i = 0; i < k; i++) {
    start = (start + step[i]) % m;
    res.push_back(pos[start]);
    for (int j = start + 1; j < m; j++) {
      pos[j - 1] = pos[j];
    }
    m--;
    if (start >= m) {
      start = 0;
    }
  }
  for (int i = 0; i < (int)res.size(); i++) {
    if (i != 0) {
      printf(" ");
    }
    printf("%d", res[i]);
  }
  return 0;
}
