#include <bits/stdc++.h>
using namespace std;
long long int n, h, m, k;
vector<pair<long long int, int> > fr;
vector<long long int> fr1;
long long int com(long long int a) {
  long long int ans = 0;
  if ((a - k + 1) >= 0) {
    long long int in1, in2;
    in1 = lower_bound(fr1.begin(), fr1.end(), a - k + 1) - fr1.begin();
    in2 = upper_bound(fr1.begin(), fr1.end(), a - 1) - fr1.begin();
    in2--;
    ans += (in2 - in1 + 1);
  } else {
    long long int in1, in2;
    in1 = lower_bound(fr1.begin(), fr1.end(), 0) - fr1.begin();
    in2 = upper_bound(fr1.begin(), fr1.end(), a - 1) - fr1.begin();
    in2--;
    ans += (in2 - in1 + 1);
    in1 = lower_bound(fr1.begin(), fr1.end(), a - k + m + 1) - fr1.begin();
    in2 = upper_bound(fr1.begin(), fr1.end(), m - 1) - fr1.begin();
    in2--;
    ans += (in2 - in1 + 1);
  }
  long long int in1, in2;
  in1 = lower_bound(fr1.begin(), fr1.end(), a + m / 2 - k + 1) - fr1.begin();
  in2 = upper_bound(fr1.begin(), fr1.end(), a + m / 2 - 1) - fr1.begin();
  in2--;
  ans += (in2 - in1 + 1);
  return ans;
}
int main() {
  cin >> n >> h >> m >> k;
  vector<long long int> chk;
  for (int i = 0; i < n; ++i) {
    long long int a, b;
    cin >> a >> b;
    fr.push_back(make_pair(b, i));
    fr1.push_back(b);
    chk.push_back(min((b - m / 2 + m) % m, b));
    if ((b + k) % m < m / 2)
      chk.push_back((b + k) % m);
    else
      chk.push_back((b + k - m / 2) % m);
  }
  sort(fr.begin(), fr.end());
  sort(fr1.begin(), fr1.end());
  long long int ans = n + 1, in = 0;
  for (int i = 0; i < (int)chk.size(); i++) {
    long long int temp = com(chk[i]);
    if (temp < ans) {
      ans = temp;
      in = chk[i];
    }
  }
  vector<int> res;
  for (int i = 0; i < n; i++) {
    if ((((in - fr[i].first + m) % m < k) &&
         ((in - fr[i].first + m) % m > 0)) ||
        (((in - fr[i].first + m + m / 2) % m < k) &&
         ((in + m / 2 - fr[i].first + m) % m > 0))) {
      res.push_back(fr[i].second);
    }
  }
  cout << res.size() << " " << in << "\n";
  for (int temp : res) cout << temp + 1 << " ";
  cout << "\n";
}
