#include <bits/stdc++.h>
using namespace std;
long long int min(long long int a, long long int b) { return a < b ? a : b; }
long long int min(long long int a, long long int b, long long int c) {
  a = min(a, b);
  a = min(a, c);
  return a;
}
long long int max(long long int a, long long int b) { return a > b ? a : b; }
long long int max(long long int a, long long int b, long long int c) {
  a = max(a, b);
  a = max(a, c);
  return a;
}
long long int dsum(long long int n) {
  long long int ans = 0;
  while (n) {
    ans += (n % 10);
    n /= 10;
  }
  return ans;
}
long long int power(long long int a, long long int b) {
  long long int res = 1;
  while (b) {
    if (b & 1) res = res * a;
    a = a * a;
    b >>= 1;
  }
  return res;
}
long long int dx[] = {1, -1, 0, 0};
long long int dy[] = {0, 0, 1, -1};
struct pll {
  long long int x, y;
};
bool comp(pll a, pll b) {
  if (a.x == b.x)
    return a.y < b.y;
  else
    return a.x < b.x;
}
void solve() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  char ch;
  double aa, bb, cc;
  string s1, s2, s3, str;
  long long int i, j, k, a, b, c, d, m, n, sum = 0, ans = 0, temp, t, q;
  cin >> n >> k;
  long long int arr[k + 1];
  for (i = 1; i <= k; i++) cin >> arr[i];
  vector<long long int> v;
  for (i = 0; i < n; i++) v.push_back(i);
  long long int me = 0;
  for (i = 1; i <= k; i++) {
    a = (me + arr[i]) % n;
    cout << v[a] + 1 << " ";
    v.erase(v.begin() + a);
    n--;
    a %= n;
    me = a;
  }
}
int main() {
  long long int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
