#include <bits/stdc++.h>
using namespace std;
int n, k, m;
int a[110];
int korak(int x) {
  do {
    x++;
    if (x == n) {
      x = 0;
    }
  } while (a[x] == 0);
  return x;
}
int main() {
  cin >> n >> k;
  m = n;
  for (int i = 0; i < n; i++) {
    a[i] = i + 1;
  }
  int x = 0;
  for (int i = 0; i < k; i++) {
    int tmp;
    cin >> tmp;
    tmp = tmp % m;
    while (tmp--) {
      x = korak(x);
    }
    cout << a[x] << " ";
    a[x] = 0;
    x = korak(x);
    m--;
  }
  cout << endl;
  return 0;
}
