#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  vector<int> vt;
  scanf(" %d %d", &n, &k);
  int a, l = 0;
  for (int i = 0; i < n; ++i) vt.push_back(i);
  for (int i = 0; i < k; ++i) {
    scanf(" %d", &a);
    int p = (l + a) % n;
    printf("%d ", vt[p] + 1);
    vt.erase(vt.begin() + p);
    l = p;
    n--;
  }
  return 0;
}
