#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, p, q, r, a[100000], s = -3000000000000000000, dpmi[100000],
                                       dpma[100000], dppmi[100000],
                                       dppma[100000], i;
  cin >> n >> p >> q >> r;
  for (i = 0; i < n; i++) cin >> a[i];
  dpmi[0] = a[0];
  dpma[0] = a[0];
  dppmi[n - 1] = a[n - 1];
  dppma[n - 1] = a[n - 1];
  for (i = 1; i < n; i++) {
    dpma[i] = max(dpma[i - 1], a[i]);
    dpmi[i] = min(dpmi[i - 1], a[i]);
  }
  for (i = n - 2; i >= 0; i--) {
    dppma[i] = max(dppma[i + 1], a[i]);
    dppmi[i] = min(dppmi[i + 1], a[i]);
  }
  for (i = 0; i < n; i++) {
    if (p > 0) {
      if (r > 0) {
        s = max(s, p * dpma[i] + q * a[i] + r * dppma[i]);
      } else {
        s = max(s, p * dpma[i] + q * a[i] + r * dppmi[i]);
      }
    } else {
      if (r > 0) {
        s = max(s, p * dpmi[i] + q * a[i] + r * dppma[i]);
      } else {
        s = max(s, p * dpmi[i] + q * a[i] + r * dppmi[i]);
      }
    }
  }
  cout << s;
}
