#include <bits/stdc++.h>
int main() {
  int n, i, j, k, l, x, a[101], temp[101];
  scanf("%d", &n);
  for (i = 0; i < 101; i++) a[i] = i + 1;
  scanf("%d", &k);
  for (i = 0, j = 0; i < k; i++, n--) {
    scanf("%d", &x);
    if (i != k - 1)
      printf("%d ", a[x % n]);
    else
      printf("%d\n", a[x % n]);
    for (j = 0, l = x % n + 1; j < n - 1 && l < n; j++, l++) temp[j] = a[l];
    for (l = 0; l != x % n; j++, l++) temp[j] = a[l];
    for (j = 0; j < n - 1; j++) a[j] = temp[j];
  }
  return 0;
}
