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