#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const int inf = 0x3f3f3f3f;
const double eps = 1e-7;
const int maxn = 105;
int n, k, a[maxn], vis[maxn];
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  memset(vis, 0, sizeof(vis));
  cin >> n >> k;
  int now = 1, cnt = n;
  for (int i = 0; i < k; i++) {
    cin >> a[i];
    int nxt = a[i] % cnt;
    cnt--;
    while (nxt--) {
      do {
        now++;
        if (now > n) now = 1;
      } while (vis[now]);
    }
    cout << now << " ";
    vis[now] = 1;
    do {
      now++;
      if (now > n) now = 1;
    } while (vis[now]);
  }
  cout << endl;
  return 0;
}
