#include <bits/stdc++.h>
using namespace std;
int const INF = 1000000000;
const int MOD = 998244353;
const int N = 1e6 + 10;
const long double EPS = 3e-16;
void faster() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int simple(int n) {
  int i, sq;
  if (n % 2 == 0) {
    return 0;
  }
  sq = (int)sqrt(n);
  for (i = 3; i <= sq; i++) {
    if ((n % i) == 0) {
      return 0;
    }
  }
  return 1;
}
long long gcd(long long a, long long b) {
  if (a > b) swap(a, b);
  if (!a) return b;
  return gcd(b % a, a);
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long is_prime(long long n) {
  if (n <= 1 || n > 3 && (n % 2 == 0 || n % 3 == 0)) return 0;
  for (long long i = 5, t = 2; i * i <= n; i += t, t = 6 - t)
    if (n % i == 0) return 0;
  return 1;
}
int a[1000];
void solve() {
  int n, k;
  cin >> n >> k;
  int now = 0;
  for (int i = 0; i < k; ++i) {
    int tmp;
    cin >> tmp;
    tmp %= (n - i);
    for (int q = 0; q < tmp; ++q) {
      while (true) {
        now++;
        now %= n;
        if (!a[now]) break;
      }
    }
    cout << now + 1 << " ";
    a[now] = 1;
    while (true) {
      now++;
      now %= n;
      if (a[now] == false) break;
    }
  }
}
int main() {
  faster();
  int T = 1;
  while (T--) {
    solve();
  }
}
