#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const long long LINF = INF * (long long)INF;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  vector<int> ch(n);
  for (int i = (0); i < (n); i++) {
    ch[i] = i;
  }
  int ind = 0;
  for (int i = (0); i < (k); i++) {
    int a;
    cin >> a;
    int toRemove = (ind + a) % ch.size();
    if (toRemove == ch.size() - 1) {
      ind = 0;
    } else {
      ind = toRemove;
    }
    cout << ch[toRemove] + 1 << " ";
    ch.erase(ch.begin() + toRemove);
  }
  return 0;
}
