#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T read() {
  T x = 0, w = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') w = -w;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  return x * w;
}
template <class T>
inline T& read(T& x) {
  return x = read<T>();
}
vector<pair<int, int> > a;
int main() {
  int n = read<int>();
  int H = read<int>(), M = read<int>(), K = read<int>();
  for (int i = 1; i <= n; ++i) {
    int h = read<int>(), m = read<int>();
    if (m >= M / 2) m -= M / 2;
    a.push_back({m, i});
  }
  sort(a.begin(), a.end());
  pair<int, int> ans = {n, 0};
  for (const pair<int, int>& t : a) {
    int sum = 0;
    if (t.first < K) {
      sum = lower_bound(a.begin(), a.end(), make_pair(t.first, 0)) - a.begin();
      sum += a.end() - upper_bound(a.begin(), a.end(),
                                   make_pair(M / 2 - (K - t.first), n + 1));
    } else
      sum = lower_bound(a.begin(), a.end(), make_pair(t.first, 0)) -
            upper_bound(a.begin(), a.end(), make_pair(t.first - K, n + 1));
    ans = min(ans, make_pair(sum, t.first));
  }
  printf("%d %d\n", ans.first, ans.second);
  if (ans.second < K) {
    vector<pair<int, int> >::iterator end =
        lower_bound(a.begin(), a.end(), make_pair(ans.second, 0));
    for (vector<pair<int, int> >::iterator i = a.begin(); i != end; ++i)
      printf("%d ", i->second);
    for (vector<pair<int, int> >::iterator i = upper_bound(
             a.begin(), a.end(), make_pair(M / 2 - (K - ans.second), n + 1));
         i != a.end(); ++i)
      printf("%d ", i->second);
  } else {
    vector<pair<int, int> >::iterator end =
        lower_bound(a.begin(), a.end(), make_pair(ans.second, 0));
    for (vector<pair<int, int> >::iterator i =
             upper_bound(a.begin(), a.end(), make_pair(ans.second - K, n + 1));
         i != end; ++i)
      printf("%d ", i->second);
  }
  puts("");
  return 0;
}
