#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
const int maxn = 1e5;
const int inf = 1e9 + 1;
int last = 1;
int t[50 * maxn], vl[50 * maxn], vr[50 * maxn];
int st, ed, dt, res;
void get_segm(int v, int l, int r) {
  if (v == -1 || l >= ed || r <= st) return;
  if (st <= l && r <= ed) {
    res += t[v];
    return;
  }
  get_segm(vl[v], l, (l + r) / 2);
  get_segm(vr[v], (l + r) / 2, r);
}
void upd_segm(int v, int l, int r) {
  if (l >= ed || r <= st) return;
  if (st <= l && r <= ed) {
    t[v] += dt;
    return;
  }
  if (vl[v] == -1) {
    vl[v] = ++last;
  }
  if (vr[v] == -1) {
    vr[v] = ++last;
  }
  upd_segm(vl[v], l, (l + r) / 2);
  upd_segm(vr[v], (l + r) / 2, r);
  t[v] = t[vl[v]] + t[vr[v]];
}
int n, h, m, k;
int get_cnt(int tm) {
  int cnt = 0;
  if (tm - k + 1 < 0) {
    st = tm - k + 1 + m;
    ed = inf;
    res = 0;
    get_segm(1, 0, inf);
    cnt += res;
    st = 0;
    ed = tm;
    res = 0;
    get_segm(1, 0, inf);
    cnt += res;
  } else {
    st = tm - k + 1;
    ed = tm;
    res = 0;
    get_segm(1, 0, inf);
    cnt += res;
  }
  return cnt;
}
bool ok(int tm, int a) {
  if (tm - k + 1 < 0) {
    st = tm - k + 1 + m;
    ed = inf;
    if (st <= a && a < ed) {
      return true;
    }
    st = 0;
    ed = tm;
    if (st <= a && a < ed) {
      return true;
    }
  } else {
    st = tm - k + 1;
    ed = tm;
    if (st <= a && a < ed) {
      return true;
    }
  }
  return false;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cin >> n >> h >> m >> k;
  memset(vl, -1, sizeof vl);
  memset(vr, -1, sizeof vr);
  vector<int> a(n), b(n);
  vector<int> first;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
    st = b[i];
    ed = st + 1;
    dt = 1;
    first.push_back(b[i]);
    for (int j = 1; j < 5; j++) {
      first.push_back(b[i] + j);
      first.push_back(b[i] - j);
      first.push_back(b[i] + k - j);
      first.push_back(b[i] - k + j);
    }
    first.push_back(b[i] + k);
    first.push_back(b[i] - k);
    upd_segm(1, 0, inf);
  }
  int ans = -1, tt = -1;
  for (int i = 0; i < (int)(first).size(); i++) {
    int xx = first[i];
    xx = (xx % (m / 2) + (m / 2)) % (m / 2);
    int cnt = get_cnt(xx) + get_cnt(xx + m / 2);
    if (ans == -1 || cnt < ans) {
      ans = cnt;
      tt = xx;
    }
  }
  cout << ans << ' ' << tt << "\n";
  vector<int> cnt;
  for (int i = 0; i < n; i++) {
    if (ok(tt, b[i]) || ok(tt + m / 2, b[i])) {
      cnt.push_back(i + 1);
    }
  }
  for (auto &el : cnt) {
    cout << el << " ";
  }
  cout << '\n';
  return 0;
}
