#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> a;
  int l = 0, x;
  for (int i = 1; i <= n; i++) a.push_back(i);
  for (int j = 0; j < k; j++) {
    cin >> x;
    l = (l + x) % n;
    cout << a[l] << " ";
    a.erase(a.begin() + l);
    n--;
  }
}
