#include <bits/stdc++.h>
using namespace std;
bool u[111];
int main(void) {
  long long n, k;
  cin >> n >> k;
  long long idx = 0;
  for (long long i = 0; i < (long long)(k); i++) {
    long long a;
    cin >> a;
    long long m = a % (n - i);
    while (m) {
      idx = (idx + 1) % n;
      if (u[idx]) continue;
      m--;
    }
    cout << idx + 1 << " ";
    u[idx] = true;
    while (u[idx]) idx = (idx + 1) % n;
  }
  return 0;
}
