#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 205;
const int MAX_M = 20005;
const int inf = 1000000007;
const int mod = 1000000007;
int n, m, k, N;
int a[MAX_N];
int main() {
  cin >> N >> k;
  n = N;
  memset(a, 1, sizeof(a));
  int s = 1;
  while (k--) {
    int x;
    cin >> x;
    x = x % n;
    for (int i = 1; i <= x; i++) {
      s++;
      if (s == N + 1) {
        s = 1;
      }
      while (a[s] == 0) {
        s++;
        if (s == N + 1) {
          s = 1;
        }
      }
    }
    cout << s;
    a[s] = 0;
    while (a[s] == 0) {
      s++;
      if (s == N + 1) {
        s = 1;
      }
    }
    if (k != 0) cout << " ";
    n--;
  }
  cout << endl;
  return 0;
}
