#include <bits/stdc++.h>
using namespace std;
int main() {
  int id[400], n, k;
  while (~scanf("%d%d", &n, &k)) {
    int x = 0, num;
    for (int i = 1; i <= n; ++i) id[i] = i;
    for (int i = 1; i <= k; ++i) {
      cin >> num;
      x += num;
      x %= n;
      if (i != 1) printf(" ");
      printf("%d", id[x + 1]);
      n--;
      for (int j = x + 1; j <= n; ++j) id[j] = id[j + 1];
    }
  }
  return 0;
}
