#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int N = 200031;
long long n, h, k, m, trash, V, train[N];
vector<pair<long long, long long> > events;
long long baseline, best_time, best_ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> h >> m >> k;
  for (int i = 1; i <= n; i++) {
    cin >> trash >> V;
    if (V >= m / 2) V -= m / 2;
    train[i] = V;
    if (V > m / 2 - k) {
      events.push_back(make_pair(V + k - m / 2, 1));
      events.push_back(make_pair(V + 1, -1));
    } else {
      baseline++;
      events.push_back(make_pair(V + 1, -1));
      events.push_back(make_pair(V + k, 1));
    }
  }
  best_time = 0;
  best_ans = baseline;
  sort(events.begin(), events.end());
  for (int i = 0; i < events.size(); i++) {
    if (events[i].second == -1)
      baseline--;
    else
      baseline++;
    if (baseline > best_ans) {
      best_ans = baseline;
      best_time = events[i].first;
    }
  }
  cout << n - best_ans << " " << best_time << endl;
  vector<int> ans;
  for (int i = 1; i <= n; i++) {
    int ok = 1;
    if (train[i] > best_time - k && train[i] < best_time) ok = 0;
    if (train[i] > best_time + m / 2 - k && train[i] < best_time + m / 2)
      ok = 0;
    if (!ok) {
      ans.push_back(i);
    }
  }
  for (int i = 0; i < ans.size(); i++) {
    if (i) cout << " ";
    cout << ans[i];
  }
  cout << endl;
  cin.get();
  cin.get();
  return 0;
}
