#include <bits/stdc++.h>
using namespace std;
const long long mod = (long long)1e9 + 7;
long long n, h, m, k;
vector<pair<long long, long long>> rems;
void solve() {
  cin >> n >> h >> m >> k;
  for (int i = 1; i <= n; ++i) {
    int x, y;
    cin >> x >> y;
    long long minutes = x * m + y;
    rems.emplace_back(minutes % (m / 2), i);
  }
  sort(rems.begin(), rems.end());
  for (int i = 0; i < n; ++i)
    rems.emplace_back(rems[i].first + m / 2, rems[i].second);
  long long ptr = 0, limit = k, ans = (int)1e18;
  int end = -1;
  for (int i = 0; i < rems.size(); ++i) {
    if (rems[i].first - rems[0].first < limit) continue;
    while (ptr <= i && rems[i].first - rems[ptr].first >= limit) ++ptr;
    --ptr;
    if (ans > i - ptr + 1) {
      ans = i - ptr + 1;
      end = i;
    }
  }
  cout << ans - 2 << " " << (rems[end].first % (m / 2)) << "\n";
  for (int i = end; i >= 0; --i) {
    if (0 < rems[end].first - rems[i].first &&
        rems[end].first - rems[i].first < limit)
      cout << rems[i].second << " ";
  }
  cout << "\n";
}
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  for (int i = 1; i <= t; ++i) {
    solve();
  }
  return 0;
}
