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