#include <bits/stdc++.h>
using namespace std;
const int N = 100100;
long long n, b[4], a[N], minL[N], maxL[N], minR[N], maxR[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= 3; i++) cin >> b[i];
  minL[0] = 1e15;
  maxL[0] = -1e15;
  minR[n + 1] = 1e15;
  maxR[n + 1] = -1e15;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    minL[i] = min(minL[i - 1], a[i]);
    maxL[i] = max(maxL[i - 1], a[i]);
  }
  for (int i = n; i >= 1; i--) {
    minR[i] = min(minR[i + 1], a[i]);
    maxR[i] = max(maxR[i + 1], a[i]);
  }
  long long res = -4e18;
  for (int i = 1; i <= n; i++) {
    long long sum = b[2] * a[i];
    if (b[1] < 0)
      sum += minL[i] * b[1];
    else
      sum += maxL[i] * b[1];
    if (b[3] < 0)
      sum += minR[i] * b[3];
    else
      sum += maxR[i] * b[3];
    res = max(res, sum);
  }
  cout << res << endl;
  return 0;
}
