#include <bits/stdc++.h>
using namespace std;
int a[110];
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> v;
  for (int i = 0; i < k; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) v.push_back(i);
  int lea = 0;
  for (int i = 0; i < k && v.size() > 0; i++) {
    lea %= v.size();
    int next = (lea + a[i]) % v.size();
    cout << v[next] << " ";
    v.erase(v.begin() + next);
    lea = next;
  }
  cout << endl;
  return 0;
}
