#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, C;
  cin >> N >> M >> C;
  int a[1100];
  for (int n = 0; n < N; n++) a[n] = 0;
  bool won = false;
  while (!won) {
    int p;
    cin >> p;
    if (p <= C / 2) {
      for (int i = 0; i < N; i++) {
        if (a[i] == 0 || a[i] > p) {
          a[i] = p;
          cout << (i + 1) << endl;
          break;
        }
      }
    } else {
      for (int i = N - 1; i >= 0; i--) {
        if (a[i] == 0 || a[i] < p) {
          a[i] = p;
          cout << (i + 1) << endl;
          break;
        }
      }
    }
    won = true;
    for (int n = 1; n < N; n++) {
      if (a[n] < a[n - 1] || a[n] == 0 || a[n - 1] == 0) {
        won = false;
        break;
      }
    }
  }
  return 0;
}
