#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
int a[maxn];
int dpmax[maxn][40], dpmin[maxn][40];
int n;
long long p, q, r;
void makeMax() {
  for (int i = 1; i <= n; i++) dpmax[i][0] = a[i];
  for (int j = 1; j <= log((double)n) / log(2.0); j++) {
    for (int i = 1; i + (1 << j) - 1 <= n; i++) {
      dpmax[i][j] = max(dpmax[i][j - 1], dpmax[i + (1 << (j - 1))][j - 1]);
    }
  }
}
void makeMin() {
  for (int i = 1; i <= n; i++) dpmin[i][0] = a[i];
  for (int j = 1; j <= log((double)n) / log(2.0); j++) {
    for (int i = 1; i + (1 << j) - 1 <= n; i++) {
      dpmin[i][j] = min(dpmin[i][j - 1], dpmin[i + (1 << (j - 1))][j - 1]);
    }
  }
}
int getMax(int l, int r) {
  int k = (int)(log((double)(r - l + 1)) / log(2.0));
  return max(dpmax[l][k], dpmax[r - (1 << k) + 1][k]);
}
int getMin(int l, int r) {
  int k = (int)(log((double)(r - l + 1)) / log(2.0));
  return min(dpmin[l][k], dpmin[r - (1 << k) + 1][k]);
}
int main() {
  cin >> n >> p >> q >> r;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  makeMax(), makeMin();
  long long ans = -0x3f3f3f3f3f3f3f3f;
  for (int i = 1; i <= n; i++) {
    long long t = q * (long long)a[i];
    if (p > 0) {
      t += p * (long long)getMax(1, i);
    } else {
      t += p * (long long)getMin(1, i);
    }
    if (r > 0) {
      t += r * (long long)getMax(i, n);
    } else {
      t += r * (long long)getMin(i, n);
    }
    ans = max(ans, t);
  }
  cout << ans << endl;
  return 0;
}
