#include <bits/stdc++.h>
using namespace std;
int n, k, cap, a[105];
bool alive[105];
int next(int first) {
  first = (first + 1) % n;
  while (!alive[first]) first = (first + 1) % n;
  return first;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < k; i++) scanf("%d", a + i);
  for (int i = 0; i < n; i++) alive[i] = 1;
  for (int i = 0; i < k; i++) {
    int rd = a[i] % (n - i);
    int j = cap;
    while (rd--) {
      j = next(j);
    }
    alive[j] = 0;
    cap = next(j);
    printf("%d ", j + 1);
  }
  printf("\n");
  return 0;
}
