#include <bits/stdc++.h>
using namespace std;
int a[105];
int main() {
  vector<int> v;
  int i, n, k;
  cin >> n >> k;
  for (i = 1; i <= n; i++) {
    v.push_back(i);
  }
  for (i = 0; i < k; i++) {
    cin >> a[i];
  }
  int pos = 0;
  int j = 0;
  while (k--) {
    pos = (pos + a[j++]) % v.size();
    cout << v[pos];
    if (k) cout << " ";
    v.erase(v.begin() + pos);
  }
  cout << endl;
  return 0;
}
