#include <bits/stdc++.h>
using namespace std;
long long A[200010], B[200010];
int main() {
  long long i, n, h, m, k;
  long long a, b, c;
  cin >> n >> h >> m >> k;
  for (i = 1; i <= n; i++) {
    scanf("%lld%lld", &a, &b);
    a = a * m + b;
    A[i] = B[i] = a % (m / 2);
  }
  sort(A + 1, A + 1 + n);
  for (i = 1; i <= n; i++) A[i + n] = A[i] + m / 2;
  a = 1;
  b = 0;
  for (i = 1; i <= 2 * n; i++) {
    while (A[i] - A[a] > m / 2 - k) a++;
    if (b < i - a + 1) {
      b = i - a + 1;
      c = A[i];
    }
  }
  c %= (m / 2);
  a = (c + k) % (m / 2);
  cout << n - b << " " << a << endl;
  for (i = 1; i <= n; i++) {
    if (B[i] > c && B[i] - c < k) cout << i << " ";
    if (B[i] < c && B[i] < c - (m / 2 - k)) cout << i << " ";
  }
  cout << endl;
}
