#include <bits/stdc++.h>
using namespace std;
const int N = 100;
int a[N], n, k, was[N];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < k; ++i) scanf("%d", a + i);
  int p = 0, shift, t = n;
  for (int i = 0; i < k; ++i, --t, p = ++p % n) {
    shift = a[i] % t;
    for (; shift > 0 || was[p]; p = ++p % n) {
      if (was[p] == 0) --shift;
    }
    was[p] = 1;
    printf("%d ", p + 1);
  }
  return 0;
}
