#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, H, M, K;
  cin >> N >> H >> M >> K;
  multiset<long long> m;
  multiset<long long> m_1;
  map<long long, long long> msum;
  vector<long long> mvec(N);
  for (int i = 0; i < N; i++) {
    long long htmp, mtmp;
    cin >> htmp >> mtmp;
    m.insert(mtmp);
    m_1.insert(-mtmp);
    mvec[i] = mtmp;
  }
  int msumtmp = 0;
  for (long long mtmp : m) {
    msumtmp++;
    msum[mtmp] = msumtmp;
  }
  long long ans = 4000000000000000000LL;
  long long ansm = 0;
  for (long long mtmp : m) {
    long long t1_begin = mtmp + 1;
    long long t2_begin = (t1_begin + M / 2) % M;
    long long t1_end = (mtmp + K) % M;
    long long t2_end = (t1_end + M / 2) % M;
    long long it_t1_begin = *m_1.upper_bound(-t1_begin);
    long long it_t2_begin = *m_1.upper_bound(-t2_begin);
    long long it_t1_end = *m_1.upper_bound(-t1_end);
    long long it_t2_end = *m_1.upper_bound(-t2_end);
    long long anstmp1 = msum[-it_t1_end] - msum[-it_t1_begin];
    if (anstmp1 < 0) anstmp1 += N;
    long long anstmp2 = msum[-it_t2_end] - msum[-it_t2_begin];
    if (anstmp2 < 0) anstmp2 += N;
    long long anstmp = anstmp1 + anstmp2;
    if (ans > anstmp) {
      ans = anstmp;
      ansm = mtmp;
    }
  }
  long long t1_begin = ansm + 1;
  long long t2_begin = (t1_begin + M / 2) % M;
  long long t1_end = (ansm + K) % M;
  long long t2_end = (t1_end + M / 2) % M;
  vector<long long> ansvec;
  long long tans = min(t1_end, t2_end);
  for (int i = 0; i < N; i++) {
    if (t1_begin > t1_end) {
      if (mvec[i] >= t1_begin || mvec[i] < t1_end) ansvec.push_back(i + 1);
    } else {
      if (mvec[i] >= t1_begin && mvec[i] < t1_end) ansvec.push_back(i + 1);
    }
    if (t2_begin > t2_end) {
      if (mvec[i] >= t2_begin || mvec[i] < t2_end) ansvec.push_back(i + 1);
    } else {
      if (mvec[i] >= t2_begin && mvec[i] < t2_end) ansvec.push_back(i + 1);
    }
  }
  cout << ansvec.size() << " " << tans << endl;
  for (int i = 0; i < ansvec.size(); i++) cout << ansvec[i] << endl;
  return 0;
}
