#include <bits/stdc++.h>
using namespace std;
bool exceed(long long x, long long y, long long m) { return x >= m / y + 1; }
long long n, k;
long long a[105];
vector<long long> vec;
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k;
  for (long long(i) = (1); (i) <= (k); (i)++) cin >> a[i];
  for (long long(i) = (1); (i) <= (n); (i)++) vec.push_back(i);
  long long p = 0;
  for (long long(i) = (1); (i) <= (k); (i)++) {
    long long np = (p + a[i]) % (long long)vec.size();
    cout << vec[np] << " ";
    vec.erase(vec.begin() + np);
    p = np % (long long)vec.size();
  }
  cout << endl;
  return 0;
}
