#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
struct train {
  int first, second, idx;
};
int n, h, m, k;
train a[MAXN];
bool comp(train x, train y) { return x.second < y.second; }
int binary_search(int x) {
  int l = 1, r = n, ans = 0;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (a[mid].second <= x) {
      ans = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  return ans;
}
int Count(int l, int r) {
  if (r < l)
    return 0;
  else
    return binary_search(r) - binary_search(l - 1);
}
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> h >> m >> k;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i].first >> a[i].second;
    a[i].idx = i;
  }
  sort(a + 1, a + n + 1, comp);
  int ans = n + 1, time;
  for (int i = 1; i <= n; ++i) {
    if (i != 1 and a[i].second == a[i - 1].second) continue;
    int t = a[i].second, r1, r2;
    if (t >= m / 2) t -= m / 2;
    if (t - k < 0)
      r1 = Count(m + t - k + 1, m - 1) + Count(0, t - 1);
    else
      r1 = Count(t - k + 1, t - 1);
    r1 += Count(m / 2 + t - k + 1, m / 2 + t - 1);
    if (r1 < ans) {
      ans = r1;
      time = t;
    }
    r2 = Count(t + 1, t + k - 1);
    if (m / 2 + t + k >= m)
      r2 += Count(m / 2 + t + 1, m - 1) + Count(0, t + k - m / 2 - 1);
    else
      r2 += Count(m / 2 + t + 1, m / 2 + t + k - 1);
    if (r2 < ans) {
      ans = r2;
      time = t + k;
      if (time >= m / 2) time -= m / 2;
    }
  }
  cout << ans << ' ' << time << endl;
  for (int i = 1; i <= n; ++i) {
    if (a[i].second >= m / 2) a[i].second -= m / 2;
    if (time - k < a[i].second and a[i].second < time)
      cout << a[i].idx << ' ';
    else if (m / 2 + time - k < a[i].second)
      cout << a[i].idx << ' ';
  }
  cout << endl;
  return 0;
}
