#include <bits/stdc++.h>
using namespace std;
int n;
int k;
int main() {
  scanf("%d %d", &n, &k);
  int ai;
  int start = 0;
  int res[110];
  for (int i = 0; i < n; i++) res[i] = i;
  while (k--) {
    scanf("%d", &ai);
    int resdel = (start + ai) % n;
    printf("%d ", res[resdel] + 1);
    start = resdel + 1;
    for (int i = resdel; i < n - 1; i++) res[i] = res[i + 1];
    start--;
    n--;
  }
  return 0;
}
