#include <bits/stdc++.h>
using namespace std;
bool check(vector<int> vec) {
  if (vec.size() == 1 && vec[0] != -1) return true;
  bool flag = true;
  for (int i = 1; i < vec.size(); ++i) {
    int a = vec[i - 1];
    int b = vec[i];
    flag &= ((b >= a) && (b != -1) && (a != -1));
  }
  return flag;
}
int main() {
  int n, m, c;
  cin >> n >> m >> c;
  int cur;
  vector<int> sheets(n);
  for (int i = 0; i < n; ++i) sheets[i] = -1;
  int sheet, temp;
  while (1) {
    cin >> cur;
    if (cur > c / 2) {
      sheet = n;
      while (cur <= sheets[sheet - 1] && sheets[sheet - 1] != -1) sheet--;
    } else {
      sheet = 1;
      while (cur >= sheets[sheet - 1] && sheets[sheet - 1] != -1) sheet++;
    }
    sheets[sheet - 1] = cur;
    cout << sheet;
    cout << endl;
    if (check(sheets)) {
      cout << endl;
      return 0;
    }
  }
  cout << endl;
  return 0;
}
