#include <bits/stdc++.h>
using namespace std;
long long binpow(long long a, long long b, long long m) {
  long long res = 1;
  for (b %= m - 1, a %= m; b > 0; b >>= 1, a = a * a % m)
    if (b & 1) res = res * a % m;
  return res;
}
int n;
int cv(int x) {
  if (x == 0) return n;
  if (x == n + 1) return 1;
  return x;
}
int main() {
  int h, m, k;
  cin >> n >> h >> m >> k;
  int hr[n + 1], mi[n + 1];
  for (int i = (1); i <= (n); ++i) cin >> hr[i] >> mi[i], mi[i] %= m / 2;
  pair<int, int> temp1[n + 1];
  for (int i = (1); i <= (n); ++i) temp1[i].first = mi[i], temp1[i].second = i;
  sort(temp1 + 1, temp1 + 1 + n);
  for (int i = (1); i <= (n); ++i) mi[i] = temp1[i].first;
  int ivl = m / 2 - k;
  int i = 1, j = 1;
  int maxtt = 0;
  int pos = 0;
  int finali, finalj;
  for (i = 1; i <= n; i++) {
    if (i - 1 == j || (i == 1 && j == n)) j = i;
    while (((mi[j] - mi[i] + m / 2) % (m / 2)) <= ivl) {
      j++;
      if (j > n) j -= n;
      if (j == i) {
        cout << "0 " << mi[i];
        exit(0);
      }
    }
    j--;
    if (j == 0) j += n;
    if (j >= i) {
      if (j - i + 1 > maxtt)
        maxtt = j - i + 1, pos = mi[i], finali = i, finalj = j;
    } else {
      if (j + n - i + 1 > maxtt)
        maxtt = j + n - i + 1, pos = mi[i], finali = i, finalj = j;
    }
  }
  cout << n - maxtt << " " << pos << endl;
  if (n - maxtt == 0) exit(0);
  for (int temp = cv(finalj + 1); temp != finali;) {
    cout << temp1[temp].second << " ";
    temp++;
    if (temp > n) temp -= n;
  }
}
