#include <bits/stdc++.h>
using namespace std;
int N, K, x;
vector<int> v;
int main() {
  cin.sync_with_stdio(false);
  cin >> N >> K;
  for (int i = 0; i < (N); ++i) v.push_back(i);
  int pos = 0;
  for (int i = 0; i < (K); ++i) {
    cin >> x;
    x %= v.size();
    pos = (pos + x) % v.size();
    cout << v[pos] + 1 << " ";
    v.erase(v.begin() + pos);
    pos %= v.size();
  }
}
