#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 9;
long long n, k, m, h;
pair<long long, long long> a[N];
int32_t main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> n >> h >> m >> k;
  map<long long, long long> mp;
  mp[0] = 0;
  for (long long i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    long long t = y % (m / 2);
    long long l = (t + 1) % (m / 2), r = (t + k - 1 + m / 2) % (m / 2);
    a[i] = {l, r};
    if (l == r) continue;
    if (l > r) mp[l]++, l = 0;
    mp[l]++, mp[r + 1]--;
  }
  long long cnt = 0, t = 0, ans = 1e9;
  for (auto [key, val] : mp) {
    if (key >= m / 2) break;
    cnt += val;
    if (cnt < ans) ans = cnt, t = key;
  }
  cout << ans << ' ' << t << '\n';
  vector<long long> res;
  for (long long i = 0; i < n; i++) {
    auto [l, r] = a[i];
    if (l == r) continue;
    if (r > l and t >= l and t <= r)
      res.push_back(i + 1);
    else if (l > r and ((t >= l and t < m / 2) or (t >= 0 and t <= r)))
      res.push_back(i + 1);
  }
  for (auto i : res) cout << i << ' ';
}
