#include <bits/stdc++.h>
int main() {
  int n, k, a;
  bool f[105];
  scanf("%d %d", &n, &k);
  memset(f, false, sizeof(f));
  int in = 0;
  for (int i = 0; i < k; i++) {
    scanf("%d", &a);
    for (int j = a % (n - i); j > 0; j--) {
      do {
        in = (in + 1) % n;
      } while (f[in]);
    }
    f[in] = true;
    printf("%d%c", in + 1, (i == k - 1) ? '\n' : ' ');
    do {
      in = (in + 1) % n;
    } while (f[in]);
  }
  return 0;
}
