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