#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
template <class T>
void chmin(T &a, const T &b) {
  if (a > b) a = b;
}
template <class T>
void chmax(T &a, const T &b) {
  if (a < b) a = b;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N, H, M, K;
  cin >> N >> H >> M >> K;
  vector<long long> A(N), B(N);
  for (int i = 0; i < (N); ++i) cin >> A[i] >> B[i];
  long long HALF = M / 2;
  vector<pair<long long, long long>> qry;
  for (int i = 0; i < N; i++) {
    long long st = B[i] % HALF;
    if (st + K <= HALF)
      qry.push_back(make_pair(st + 1, st + K));
    else {
      qry.push_back(make_pair(0, K - (HALF - st)));
      qry.push_back(make_pair(st + 1, HALF));
    }
  }
  vector<long long> v;
  v.push_back(0);
  v.push_back(HALF);
  for (int i = 0; i < (qry.size()); ++i) {
    v.push_back(qry[i].first);
    v.push_back(qry[i].second);
  }
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  int V = v.size();
  map<long long, int> mp;
  for (int i = 0; i < (V); ++i) mp[v[i]] = i;
  vector<int> imos(V, 0);
  for (int i = 0; i < (qry.size()); ++i) {
    int a = qry[i].first;
    int b = qry[i].second;
    imos[mp[a]]++;
    imos[mp[b]]--;
  }
  for (int i = 1; i < V; i++) imos[i] += imos[i - 1];
  int mit = 0;
  for (int i = 0; i < (V); ++i)
    if (v[i] != HALF && imos[mit] > imos[i]) mit = i;
  vector<int> ans;
  for (int i = 0; i < N; i++) {
    if (B[i] >= HALF) B[i] -= HALF;
    long long dif = 0;
    if (v[mit] >= B[i])
      dif = v[mit] - B[i];
    else
      dif = v[mit] + HALF - B[i];
    if (dif < K && dif > 0) ans.push_back(i);
  }
  cout << imos[mit] << " " << v[mit] << endl;
  for (auto n : ans) cout << n + 1 << " ";
  cout << endl;
  return 0;
}
