#include <bits/stdc++.h>
using namespace std;
const size_t MAX = 200000 + 1;
uint64_t gcd(uint64_t a, uint64_t b) { return b ? gcd(b, a % b) : a; }
int main(int argc, char *argv[]) {
  ios_base::sync_with_stdio(false);
  ifstream in("input.txt");
  ofstream out("output.txt");
  int32_t n, k, a, v = 0;
  cin >> n >> k;
  vector<int32_t> childs(n);
  for (int32_t i = 1; i <= n; ++i) childs[i - 1] = i;
  for (int32_t i = 0; i < k; ++i) {
    cin >> a;
    int32_t looser = (v + a) % childs.size();
    cout << childs[looser] << " ";
    childs.erase(childs.begin() + looser);
    v = looser;
    if (v == childs.size()) v = 0;
  }
  return 0;
}
