#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const int INFi = 2e9;
const int maxN = 1e5 + 5;
const int md = 998244353;
const int md2 = 1e9 + 7;
double getTime() { return clock() / (double)CLOCKS_PER_SEC; };
void solve() {
  int n;
  int h, m, k;
  cin >> n >> h >> m >> k;
  vector<pair<int, int>> vo(n);
  for (int i = 0; i < n; ++i) cin >> vo[i].first >> vo[i].second;
  vector<int> times;
  for (int i = 0; i < n; ++i) {
    times.push_back(vo[i].second);
    if (vo[i].second < m / 2) {
      times.push_back(vo[i].second + m / 2);
    } else {
      times.push_back(vo[i].second - m / 2);
    }
  }
  sort((times).begin(), (times).end());
  int len = m / 2 - k;
  int l = 0;
  pair<int, pair<int, int>> ans = {0, {0, 0}};
  for (int r = 0; r < times.size(); ++r) {
    while (times[r] - times[l] > len) {
      l++;
    }
    ans = max(ans, {r - l + 1, {l, r}});
  }
  int start = times[ans.second.first] % (m / 2);
  cout << n - ans.first << " " << start << "\n";
  vector<int> answers;
  for (int i = 0; i < n; ++i) {
    if (m - vo[i].second + start < k) {
      answers.push_back(i);
      continue;
    }
    if (start > vo[i].second && start - k < vo[i].second) {
      answers.push_back(i);
      continue;
    }
    if (start + m / 2 > vo[i].second && start + m / 2 - k < vo[i].second) {
      answers.push_back(i);
      continue;
    }
  }
  for (auto &x : answers) cout << x + 1 << " ";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int tests = 1;
  for (int _ = 0; _ < tests; ++_) {
    solve();
  }
  return 0;
}
