#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:536870912")
#pragma warning(disable : 4996)
using namespace std;
const int N = 1005, INF = 1e9;
int a[N];
int main() {
  int n, m, c, t;
  cin >> n >> m >> c;
  t = c / 2;
  while (true) {
    int p;
    cin >> p;
    if (p <= t) {
      int i = 0;
      while (a[i] && a[i] <= p) i++;
      if (i == n) i = 0;
      a[i] = p;
      cout << i + 1 << endl;
    } else {
      int i = n - 1;
      while (a[i] && a[i] >= p && i >= 0) i--;
      if (i == -1) i = n - 1;
      a[i] = p;
      cout << i + 1 << endl;
    }
    bool ok = a[0];
    for (int i = 1; i < n; i++) {
      if (!a[i] || a[i - 1] > a[i]) {
        ok = false;
        break;
      }
    }
    if (ok) break;
  }
  return 0;
}
