#include <bits/stdc++.h>
using namespace std;
int n, m, c, lvl;
vector<int> nums;
void place1(int num) {
  for (int i = 0; i < n; i++) {
    if (num < nums[i]) {
      nums[i] = num;
    } else if (nums[i] == 0) {
      nums[i] = num;
    } else
      continue;
    cout << i + 1 << endl;
    return;
  }
}
void place2(int num) {
  for (int i = n - 1; i >= 0; i--) {
    if (num > nums[i]) {
      nums[i] = num;
    } else if (nums[i] == 0) {
      nums[i] = num;
    } else
      continue;
    cout << i + 1 << endl;
    return;
  }
}
bool check() {
  for (int i = 0; i < nums.size(); i++) {
    if (!nums[i]) return 0;
  }
  return 1;
}
int main() {
  cin >> n >> m >> c;
  nums.resize(n);
  for (int i = 0; i < m; i++) {
    int tmp;
    cin >> tmp;
    if (tmp <= c / 2) {
      place1(tmp);
    } else {
      place2(tmp);
    }
    if (check()) break;
  }
  return 0;
}
