#include <bits/stdc++.h>
using namespace std;
int n, m, h, k, x, y;
vector<pair<int, int> > G;
int main() {
  cin >> n >> h >> m >> k;
  for (int i = 1; i <= n; ++i) {
    cin >> x >> y;
    G.push_back(make_pair(y % (m / 2), i));
    G.push_back(make_pair(y % (m / 2) + (m / 2), i));
  }
  sort(G.begin(), G.end());
  pair<int, int> ans = make_pair(0x3f3f3f3f, -1);
  for (int i = 0, j = 0; i < 2 * n; ++i) {
    while (G[i].first - G[j].first >= k) j++;
    if (i >= n) ans = min(ans, make_pair(i - j, G[i].first));
  }
  cout << ans.first << " " << ans.second % (m / 2) << endl;
  for (int i = 0, r = ans.second, l = r - k; i < 2 * n; ++i)
    if (G[i].first > l && G[i].first < r) cout << G[i].second << endl;
  return 0;
}
