#include <bits/stdc++.h>
using namespace std;
const long long N = 1e3 + 5;
long long n, m, c, cur, loc;
long long a[N];
void work() {
  long long lim = c / 2 + c % 2;
  if (cur > lim) {
    for (long long i = n; i >= 1; i--) {
      if (cur > a[i] || !a[i]) {
        loc = i;
        return;
      }
    }
    loc = 1;
    return;
  } else {
    for (long long i = 1; i <= n; i++) {
      if (cur < a[i] || !a[i]) {
        loc = i;
        return;
      }
    }
    loc = n;
    return;
  }
}
bool check() {
  for (long long i = 1; i <= n; i++) {
    if (!a[i]) return 0;
  }
  for (long long i = 2; i <= n; i++) {
    if (a[i] < a[i - 1]) return 0;
  }
  return 1;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> m >> c;
  for (long long i = 1; i <= m; i++) {
    cin >> cur;
    work();
    a[loc] = cur;
    cout << loc << endl;
    if (check()) {
      return 0;
    }
  }
  return 0;
}
