#include <bits/stdc++.h>
using namespace std;
int n, k, a[111];
vector<int> v;
int main() {
  cin >> n >> k;
  for (int i = 0; i < k; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    v.push_back(i);
  }
  int ind = 0;
  for (int i = 0; i < k; i++) {
    ind %= v.size();
    int nxt = (ind + a[i]) % v.size();
    cout << v[nxt] + 1 << ' ';
    v.erase(v.begin() + nxt);
    ind = nxt;
  }
  cout << endl;
  return 0;
}
