#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long n, h, m, k;
  cin >> n >> h >> m >> k;
  m /= 2;
  vector<pair<long, long> > a;
  for (long i = 0, tmp, cur; i < n; i++) {
    cin >> tmp >> cur;
    a.push_back({cur % m, i});
    a.push_back({cur % m + m, i});
  }
  sort(a.begin(), a.end());
  long cnt = 0;
  pair<long, long> ans = {LONG_MAX, -1};
  for (long i = 0; i < 2 * n; i++) {
    long tmp = a[i].first;
    while (a[cnt].first <= tmp - k) ++cnt;
    if (i >= n) ans = min(ans, {i - cnt, tmp % m});
  }
  cout << ans.first << " " << ans.second << "\n";
  long right = ans.second + m, left = right - k;
  for (long i = 0; i < 2 * n; i++) {
    long tmp = a[i].first;
    if (a[i].first < right && a[i].first > left) cout << a[i].second + 1 << " ";
  }
  return 0;
}
