#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, k, s[105], p, pos = 0;
  cin >> n >> k;
  for (i = 0; i < n; i++) s[i] = i + 1;
  while (k--) {
    cin >> p;
    pos = (pos + p) % n;
    cout << s[pos] << " ";
    if (pos == n - 1) {
      n--;
      pos = 0;
    } else {
      for (int j = pos; j < n - 1; j++) {
        s[j] = s[j + 1];
      }
      n--;
    }
  }
  return 0;
}
