12
-6712 6
2375 73
4643 197
-5660 215
-378 223
2228 307
3305 340
3449 468
-4389 707
-7161 729
-1838 921
-1655 985
730
 5
1 5
6 7
17127 17
17072 42
17042 77
3
 7
-976754 20479
79929143 911181
9598220 82517
-51609349 810257
67416551 266544
-14170975 307690
-15476178 491195
352
 22
-5301 602
-1400 194
-8512 987
-282 962
6484 494
9091 523
-7744 92
6002 461
5053 305
-1339 272
-821 165
9308 785
929 421
8384 883
1266 157
8411 923
-2949 885
7725 687
6859 197
-7630 867
5031 918
5662 410
41

11 12
 2 3
 5 5
 9 9

#include <bits/stdc++.h>
using namespace std;
int Max(int aa, int bb) { return aa > bb ? aa : bb; }
struct node {
  int id;
  int pid;
  int x;
  int t;
};
node mm[100005];
int cmp(node aa, node bb) { return aa.x < bb.x; }
int cmp2(node aa, node bb) { return aa.t < bb.t; }
int mm2[100005];
int dp[100005];
int path[100005];
int main() {
  int ans, i, ss;
  int last, tt, j, len;
  int n, v;
  scanf("%d", &n);
  memset(dp, 0, sizeof(dp));
  for (i = 0; i < n; i++) path[i] = i;
  for (i = 0; i < n; i++) {
    scanf("%d%d", &mm[i].x, &mm[i].t);
    mm[i].pid = i;
  }
  scanf("%d", &v);
  sort(mm, mm + n, cmp);
  for (i = 0; i < n; i++) {
    mm[i].id = i;
    mm2[i] = mm[i].x;
  }
  sort(mm, mm + n, cmp2);
  last = -99999999;
  for (i = 0; i < n; i++) {
    tt = mm[i].t - last;
    len = tt * v;
    last = mm[i].t;
    for (j = mm[i].id; j < n; j++) {
      if ((mm2[j] - mm[i].x) > len) break;
      if (dp[i] < dp[j] + 1) {
        dp[i] = dp[j] + 1;
        path[mm[i].pid] = path[mm[j].pid];
      }
    }
    for (j = mm[i].id - 1; j >= 0; j--) {
      if (mm[i].x - mm2[j] > len) break;
      if (dp[i] < dp[j] + 1) {
        dp[i] = dp[j] + 1;
        path[mm[i].pid] = path[mm[j].pid];
      }
    }
  }
  ans = -1;
  for (i = 0; i < n; i++) {
    if (dp[i] > ans) {
      ans = dp[i];
      ss = path[mm[i].pid] + 1;
    }
  }
  cout << ans << " " << ss << endl;
}
