#include <bits/stdc++.h>
signed main(void) {
  int totNums, totRounds, C;
  int num[1200] = {}, _count = 0;
  scanf("%d%d%d", &totNums, &totRounds, &C);
  int x;
  while (_count < totNums) {
    scanf("%d", &x);
    if (x <= (C >> 1)) {
      for (int i = 0; i < totNums; i++) {
        if (num[i] == 0) _count++;
        if (num[i] == 0 || num[i] > x) {
          num[i] = x;
          printf("%d\n", i + 1);
          fflush(stdout);
          break;
        }
      }
    } else {
      for (int i = totNums - 1; i >= 0; i--) {
        if (num[i] == 0) _count++;
        if (num[i] == 0 || num[i] < x) {
          num[i] = x;
          printf("%d\n", i + 1);
          fflush(stdout);
          break;
        }
      }
    }
  }
  return 0;
}
