#include <bits/stdc++.h>
using namespace std;
const long dad = 1e4;
long n, boss = 1, a[dad], k;
bool kt[dad];
int main() {
  cin >> n >> k;
  for (long i = 1; i <= k; ++i) {
    cin >> a[i];
    a[i] = a[i] % (n - i + 1);
  }
  for (long i = 1; i <= k; ++i) {
    for (long j = 1; j <= a[i]; ++j) {
      ++boss;
      if (boss == n + 1) boss = 1;
      while (kt[boss] == 1) {
        ++boss;
        if (boss == n + 1) boss = 1;
      }
    }
    ++kt[boss];
    cout << boss << " ";
    while (kt[boss] == 1) {
      ++boss;
      if (boss == n + 1) boss = 1;
    }
  }
  return 0;
}
