#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  ios::sync_with_stdio(false);
  int a[500];
  while (cin >> n >> k) {
    int x = 0;
    int num;
    for (int i = 1; i <= n; i++) {
      a[i] = i;
    }
    for (int i = 0; i < k; i++) {
      cin >> num;
      x += num;
      x %= n;
      if (i != 0) {
        cout << " ";
      }
      cout << a[x + 1];
      n--;
      for (int j = x + 1; j <= n; j++) {
        a[j] = a[j + 1];
      }
    }
    cout << endl;
  }
  return 0;
}
