#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using ld = long double;
using pii = pair<int, int>;
void solve() {
  int n;
  ll h, m, k;
  cin >> n >> h >> m >> k;
  vector<pair<ll, int>> a;
  m /= 2;
  for (int i = 0; i < n; i++) {
    ll hi, mi;
    cin >> hi >> mi;
    a.emplace_back(mi % m, i);
  }
  sort(a.begin(), a.end());
  for (int i = 0; i < n; i++) a.emplace_back(a[i].first + m, a[i].second);
  int ans = 0;
  int num = n;
  for (int i = 0; i < n; i++) {
    int lo = i + 1, hi = i + n;
    while (lo < hi) {
      int mid = (lo + hi) / 2;
      if (a[i].first == a[mid].first)
        lo = mid + 1;
      else
        hi = mid;
    }
    int l = hi;
    lo = i, hi = i + n;
    while (lo < hi) {
      int mid = (lo + hi + 1) / 2;
      if (a[mid].first - a[i].first < k)
        lo = mid;
      else
        hi = mid - 1;
    }
    int r = hi;
    if (r - l + 1 < num) num = r - l + 1, ans = a[i].first;
  }
  cout << num << " " << (ans + k) % m << '\n';
  int lo = 0, hi = n;
  while (lo < hi) {
    int mid = (lo + hi) / 2;
    if (a[mid].first <= ans)
      lo = mid + 1;
    else
      hi = mid;
  }
  int l = hi;
  lo = 0, hi = l + n;
  while (lo < hi) {
    int mid = (lo + hi + 1) / 2;
    if (a[mid].first - ans < k)
      lo = mid;
    else
      hi = mid - 1;
  }
  int r = hi;
  for (int i = l; i <= r; i++) cout << a[i].second + 1 << " ";
  cout << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
