#include <bits/stdc++.h>
using namespace std;
int t[200010], tt[200010];
int main() {
  int n, h, m, k, x, ans = 1000000007, anst = 0;
  cin >> n >> h >> m >> k;
  m /= 2;
  for (int i = 0; i < n; i++) {
    cin >> x >> t[i];
    t[i] %= m;
    tt[i] = t[i];
  }
  sort(t, t + n);
  for (int i = 0; i < n; i++) t[i + n] = t[i] + m;
  int cur = 2 * n - 1;
  for (int i = 2 * n - 1; i >= n; i--) {
    while (t[cur] > t[i] - k) cur--;
    if (ans > i - cur - 1) {
      ans = i - cur - 1;
      anst = t[i] % m;
    }
  }
  cout << ans << " " << anst << endl;
  for (int i = 0; i < n; i++) {
    if (anst >= k) {
      if (tt[i] < anst && tt[i] > anst - k) cout << i + 1 << " ";
    } else {
      if (tt[i] < anst || tt[i] > anst - k + m) cout << i + 1 << " ";
    }
  }
}
