#include <bits/stdc++.h>
using namespace std;
int a[110];
int ans[110];
bool use[110];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < k; i++) {
    cin >> a[i];
  }
  int cur = 0;
  for (int i = 0; i < k; i++) {
    int inc = a[i] % (n - i);
    for (int j = 0; j < inc; j++) {
      cur++;
      if (cur >= n) cur = 0;
      while (use[cur] == true) {
        cur++;
        if (cur >= n) cur = 0;
      }
    }
    ans[i] = cur + 1;
    use[cur] = true;
    if (i + 1 < n) {
      while (use[cur] == true) {
        cur++;
        if (cur >= n) cur = 0;
      }
    }
  }
  for (int i = 0; i < k; i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
