#include <bits/stdc++.h>
using namespace std;
struct event {
  long long tip;
  long long time;
  friend bool operator<(event a, event b) {
    return a.time < b.time || (a.time == b.time && a.tip > b.tip);
  }
};
vector<event> e;
long long n, h, m, k;
int32_t main() {
  cin >> n >> h >> m >> k;
  if (k == 1) {
    cout << "0 0\n\n";
    return 0;
  }
  m /= 2;
  for (long long i = 1; i <= n; ++i) {
    long long l, r, x;
    cin >> x >> x;
    l = (x + 1) % m;
    r = (x + k) % m;
    if (l <= r) {
      e.push_back({i, l});
      e.push_back({-i, r});
    } else {
      e.push_back({i, 0});
      e.push_back({-i, r});
      e.push_back({i, l});
    }
  }
  sort(e.begin(), e.end());
  long long nr = 0, sol = (1LL << 62), opt = 0;
  if (e[0].tip < 0)
    nr--;
  else
    nr++;
  for (long long i = 1; i < e.size(); ++i) {
    if (e[i].time != e[i - 1].time && nr < sol) {
      opt = e[i - 1].time;
      sol = nr;
    }
    if (e[i].tip < 0)
      nr--;
    else
      nr++;
  }
  if (nr < sol) {
    opt = e.back().time;
    sol = nr;
  }
  cout << sol << " " << opt << "\n";
  set<long long> solv;
  for (long long i = 0; i <= e.size(); ++i) {
    if (e[i].time > opt) break;
    if (e[i].tip > 0)
      solv.insert(e[i].tip);
    else
      solv.erase(-e[i].tip);
  }
  for (auto it : solv) cout << it << " ";
  cout << "\n";
  return 0;
}
