#include <bits/stdc++.h>
int n, m, c, num, x, y, a[1010];
int main() {
  scanf("%d%d%d", &n, &m, &c);
  while (num < n) {
    scanf("%d", &x);
    if (x * 2 <= c) {
      y = 1;
      while (a[y] && a[y] <= x) y++;
    } else {
      y = n;
      while (a[y] && a[y] >= x) y--;
    }
    if (!a[y]) num++;
    a[y] = x;
    printf("%d\n", y);
    fflush(stdout);
  }
  return 0;
}
