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