#include <bits/stdc++.h>
using namespace std;
int n, k;
bool killed[110];
int a[110];
int main() {
  cin >> n >> k;
  for (int i = 0; i < k; i++) {
    cin >> a[i];
  }
  int cnt = n;
  int now = 0;
  for (int i = 0; i < k; i++) {
    a[i] %= cnt;
    int next = now;
    while (a[i]--) {
      next++;
      if (next == n) next = 0;
      while (killed[next]) {
        next++;
        if (next == n) next = 0;
      }
    }
    cout << next + 1 << ' ';
    cnt--;
    killed[next] = true;
    now = next + 1;
    if (now == n) now = 0;
    while (killed[now]) {
      now++;
      if (now == n) now = 0;
    }
  }
}
