#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, c;
  cin >> n >> m >> c;
  int arr[1009], sta = 0, end = n - 1;
  while (sta <= end) {
    int a;
    cin >> a;
    if (a <= c / 2) {
      int fl = 0;
      for (int i = 0; i < sta; i++) {
        if (arr[i] > a) {
          arr[i] = a;
          fl = 1;
          cout << i + 1 << endl;
          break;
        }
      }
      if (!fl) {
        arr[sta] = a;
        cout << sta + 1 << endl;
        sta++;
      }
    } else {
      int fl = 0;
      for (int i = n - 1; i > end; i--) {
        if (arr[i] < a) {
          arr[i] = a;
          cout << i + 1 << endl;
          fl = 1;
          break;
        }
      }
      if (!fl) {
        arr[end] = a;
        cout << end + 1 << endl;
        end--;
      }
    }
  }
  return 0;
};
