#include <bits/stdc++.h>
using namespace std;
int n, h, m, k, c[100005], b[100005], cnt, y[100005], ans = 1e9, t;
int lb(int x) { return x & (-x); }
void add(int x) {
  while (x <= cnt) {
    c[x]++;
    x += lb(x);
  }
}
int sum(int x) {
  int ans = 0;
  while (x) {
    ans += c[x];
    x -= lb(x);
  }
  return ans;
}
signed main() {
  cin >> n >> h >> m >> k;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x >> y[i];
    y[i] %= (m / 2);
    b[i] = y[i];
  }
  sort(b + 1, b + n + 1);
  cnt = unique(b + 1, b + n + 1) - b - 1;
  for (int i = 1; i <= n; i++) {
    int l = lower_bound(b + 1, b + cnt + 1, y[i]) - b;
    add(l);
  }
  for (int i = 1; i <= n; i++) {
    int l = lower_bound(b + 1, b + cnt + 1, y[i] - k + 1) - b;
    int r = upper_bound(b + 1, b + cnt + 1, y[i] - 1) - b - 1;
    int he = sum(r) - sum(l - 1);
    if (y[i] - k < 0) {
      int l = lower_bound(b + 1, b + cnt + 1, y[i] - k + m / 2 + 1) - b;
      he += sum(cnt) - sum(l - 1);
    }
    if (ans > he) ans = he, t = y[i];
  }
  printf("%d %d\n", ans, t);
  for (int i = 1; i <= n; i++)
    if ((y[i] >= t - k + 1 && y[i] < t) || (y[i] > t - k + m / 2))
      printf("%d ", i);
}
