#include <bits/stdc++.h>
using namespace std;
int n, h, k;
long long m;
int a[100005];
int b[100005];
int f(int t1, int t2) {
  int k1 = lower_bound(b + 1, b + n + 1, t1) - b;
  int k2 = upper_bound(b + 1, b + n + 1, t2) - b;
  return k2 - k1;
}
int ff(int t1, int t2) {
  t1++;
  t2--;
  t1 = (t1 % m + m) % m;
  t2 = (t2 % m + m) % m;
  int x = 0;
  if (t1 < t2) {
    x += f(t1, t2);
  } else {
    x += f(t1, m - 1);
    x += f(0, t2);
  }
  return x;
}
int main() {
  scanf("%d%d%I64d%d", &n, &h, &m, &k);
  if (k == 1) {
    printf("0 0\n\n");
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d%d", &x, &a[i]);
    b[i] = a[i];
  }
  sort(b + 1, b + n + 1);
  int ans = n;
  int t = 0;
  for (int i = 1; i <= n; i++) {
    int x = ff(a[i] - k, a[i]);
    x += ff(a[i] - k + m / 2, a[i] + m / 2);
    if (x < ans) {
      ans = x;
      t = a[i];
    }
  }
  printf("%d %d\n", ans, (t < m / 2) ? t : t - m / 2);
  vector<int> v;
  for (int i = 1; i <= n; i++) {
    if (((t - a[i] + m) % m > 0 && (t - a[i] + m) % m < k) ||
        ((t + m / 2 - a[i] + m) % m > 0 && (t + m / 2 - a[i] + m) % m < k))
      v.push_back(i);
  }
  for (int i = 0; i < ans; i++) {
    printf("%d", v[i]);
    if (i < ans - 1)
      printf(" ");
    else
      printf("\n");
  }
  return 0;
}
