#include <bits/stdc++.h>
using namespace std;
int a[1005] = {};
int main() {
  int n, m, c, sz = 0;
  cin >> n >> m >> c;
  while (sz != n) {
    int tmp, index;
    cin >> tmp;
    if (tmp <= c / 2) {
      index = 1;
      while (a[index] != 0 && a[index] <= tmp) index++;
    } else {
      index = n;
      while (a[n] != 0 && a[index] >= tmp) index--;
    }
    cout << index << '\n';
    fflush(stdout);
    if (a[index] == 0) sz++;
    a[index] = tmp;
  }
  return 0;
}
