#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
const long long maxn = 2e5 + 5;
int32_t main() {
  ios_base::sync_with_stdio(0);
  ;
  long long n, h, m, k;
  cin >> n >> h >> m >> k;
  pair<long long, long long> a[n];
  long long temp = m / 2;
  vector<long long> v;
  for (long long i = 0; i < n; ++i) {
    cin >> a[i].first >> a[i].second;
    long long currTime = a[i].first * m + a[i].second;
    v.emplace_back(currTime % temp);
    v.emplace_back(currTime % temp + temp);
  }
  sort(v.begin(), v.end());
  long long delta = temp - k;
  long long i = 0, j = 0;
  long long ans = 0, id = -1;
  while (i < v.size() / 2) {
    while (1) {
      if (j >= v.size()) break;
      if (v[j] - v[i] > delta) break;
      j++;
    }
    if (j - i > ans) {
      ans = j - i;
      id = i;
    }
    i++;
  }
  long long startTime = v[id] % temp;
  cout << max(0ll, n - ans) << " " << startTime << '\n';
  ;
  for (long long i = 0; i < n; ++i) {
    long long currTime = a[i].first * m + a[i].second;
    currTime %= temp;
    long long diff = currTime - startTime;
    if (diff < 0) diff += temp;
    if (diff <= delta) continue;
    cout << i + 1 << " ";
    ;
  }
  cout << '\n';
  return 0;
}
