#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
long long int power(long long int x, unsigned int y, long long int p) {
  long long int res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
bool isPrime(long long int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
bool sortbysec(const pair<long long int, long long int> &a,
               const pair<long long int, long long int> &b) {
  return (a.second < b.second);
}
long long int fact[1000000 + 1];
long long int bigMOD(long long int b, long long int p) {
  if (p == 0) return 1;
  long long int h = bigMOD(b, p / 2);
  h = h * h % 100000000;
  if (p & 1) h = h * b % 100000000;
  return h;
}
long long int ncr(long long int n, long long int r) {
  return fact[n] * bigMOD(fact[r] * fact[n - r] % 100000000, 100000000 - 2) %
         100000000;
}
map<long long int, long long int> prime;
bool test(long long int tmp, long long int a, long long int b,
          long long int c) {
  long long int j = 0;
  for (long long int i = a; i < a + tmp; i += 1) {
    if (prime[i] == 0) j += 1;
  }
  if (j < c) {
    return 0;
  }
  for (long long int i = a + 1; i < b - tmp + 2; i += 1) {
    if (prime[i - 1] == 0) j -= 1;
    if (prime[tmp + i - 1] == 0) j += 1;
    if (j < c) return 0;
  }
  return 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  t = 1;
  prime[1] = 1;
  while (t--) {
    long long int n, d, a, b;
    cin >> n >> d >> a >> b;
    vector<pair<long long int, long long int> > v;
    for (long long int i = 0; i < n; i += 1) {
      long long int x, y;
      cin >> x >> y;
      x *= a;
      y *= b;
      v.push_back({x + y, i + 1});
    }
    sort(v.begin(), v.end());
    long long int tmp = 0;
    for (long long int i = 0; i < n; i += 1) {
      if (tmp + v[i].first <= d)
        tmp += v[i].first;
      else {
        tmp = i;
        break;
      }
      if (i == n - 1) tmp = n;
    }
    cout << tmp << "\n";
    for (long long int i = 0; i < tmp; i += 1) {
      cout << v[i].second << " ";
    }
  }
  cerr << "\n" << (float)clock() / CLOCKS_PER_SEC * 1000 << " ms" << endl;
  return 0;
}
