#include <bits/stdc++.h>
using namespace std;
int pos[109], npos[109];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) pos[i] = i;
  for (int i = 1; i <= k; ++i) {
    int cnt;
    cin >> cnt;
    int el = (1 + cnt) % n;
    if (el == 0) el = n;
    cout << pos[el] << " ";
    int nw = 0, st = (el + 1) % n;
    if (st == 0) st = n;
    for (int j = 1; j < n; ++j) {
      npos[++nw] = pos[st];
      ++st;
      st %= n;
      if (st == 0) st = n;
    }
    --n;
    for (int j = 1; j <= n; ++j) pos[j] = npos[j];
  }
  cout << endl;
  return 0;
}
