#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> id(n);
  for (int i = 0; i < n; i++) {
    id[i] = i + 1;
  }
  int ptr = 0;
  while (k--) {
    int a;
    cin >> a;
    a %= id.size();
    while (a--) {
      ++ptr;
      if (ptr == id.size()) {
        ptr = 0;
      }
    }
    cout << id[ptr] << " ";
    vector<int> alive;
    for (int i = 0; i < id.size(); i++) {
      if (i != ptr) {
        alive.push_back(id[i]);
      }
    }
    id.swap(alive);
    if (ptr == id.size()) {
      ptr = 0;
    }
  }
  cout << endl;
  return 0;
}
