#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
const long long mod = 1e9 + 7;
int n, m, h, k, nn, bb[maxn], a[maxn], b[maxn], s[maxn], ans, tim;
map<int, int> mp;
int main() {
  cin >> n >> h >> m >> k;
  nn = n;
  m /= 2;
  for (int i = 1; i <= n; i++) {
    scanf("%d %d", &a[i], &b[i]);
    if (b[i] >= m) {
      b[i] -= m;
    }
    bb[i] = b[i];
    mp[b[i]]++;
  }
  n = 0;
  for (auto i : mp) {
    n++;
    a[n] = i.first;
    b[n] = i.second;
  }
  for (int i = 1; i <= n; i++) {
    a[i + n] = a[i] + m;
    b[i + n] = b[i];
  }
  n *= 2;
  for (int i = 1; i <= n; i++) {
    b[i] += b[i - 1];
  }
  ans = nn;
  int j = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] < k) {
      continue;
    }
    while (j + 1 <= i && a[i] - a[j + 1] >= k) {
      j++;
    }
    if (b[i - 1] - b[j] <= ans) {
      ans = b[i - 1] - b[j];
      if (a[i] >= m) {
        tim = a[i] - m;
      } else {
        tim = a[i];
      }
    }
  }
  cout << ans << " " << tim << endl;
  for (int i = 1; i <= nn; i++) {
    if (tim >= k) {
      if (tim - k < bb[i] && bb[i] < tim) {
        printf("%d ", i);
      }
    } else {
      if (m + tim - k < bb[i] || bb[i] < tim) {
        printf("%d ", i);
      }
    }
  }
  cout << endl;
  return 0;
}
