#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, k;
  long long a[101];
  cin >> n >> k;
  for (long long i = 0; i < k; i++) cin >> a[i];
  vector<long long> v;
  for (long long i = 1; i <= n; i++) v.push_back(i);
  for (long long i = 0; i < k; i++) {
    a[i] %= v.size();
    for (long long j = 0; j < a[i]; j++)
      rotate(v.begin(), v.begin() + 1, v.end());
    cout << v[0] << " ";
    v.erase(v.begin());
  }
  cout << endl;
  return 0;
}
