#include <bits/stdc++.h>
using namespace std;
int a[110];
int n, k;
void Do(int x, vector<int> v) {
  if (x == k) return;
  int n = v.size();
  int t = a[x] % n;
  cout << v[t] << " ";
  vector<int> w;
  for (int i = 1; i < n; i++) {
    w.push_back(v[(t + i) % n]);
  }
  Do(x + 1, w);
}
void solve() {
  cin >> n >> k;
  vector<int> v;
  for (int i = 0; i < k; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    v.push_back(i);
  }
  Do(0, v);
}
int main() {
  solve();
  cout << endl;
  return 0;
}
