#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.1415926535897932384626433;
const int mod = 1000000007;
const long long inf = 3e18;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, k;
  cin >> n >> k;
  vector<long long> a(k), v;
  for (long long i = 0; i < k; i++) {
    cin >> a[i];
  }
  for (long long i = 0; i < n; i++) {
    v.push_back(i + 1);
  }
  long long curl = 0;
  for (long long i = 0; i < k; i++) {
    long long j = curl + a[i];
    j %= v.size();
    cout << v[j] << " ";
    vector<long long> vc;
    for (long long k = 0; k < v.size(); k++) {
      if (k == j) continue;
      vc.push_back(v[k]);
    }
    v = vc;
    curl = (j) % n;
  }
}
