#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, p, q, r;
  cin >> n >> p >> q >> r;
  long long arr[n];
  long long minstart[n], maxstart[n], minend[n], maxend[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  minstart[0] = arr[0];
  maxstart[0] = arr[0];
  minend[n - 1] = arr[n - 1];
  maxend[n - 1] = arr[n - 1];
  for (int i = 1; i < n; i++) {
    minstart[i] = min(minstart[i - 1], arr[i]);
    maxstart[i] = max(maxstart[i - 1], arr[i]);
    minend[n - i - 1] = min(minend[n - i], arr[n - i - 1]);
    maxend[n - i - 1] = max(maxend[n - i], arr[n - i - 1]);
  }
  long long ans = LLONG_MIN;
  for (int i = 0; i < n; i++) {
    long long temp = 0;
    temp += q * arr[i];
    temp += (p > 0) ? (maxstart[i] * p) : (minstart[i] * p);
    temp += (r > 0) ? (maxend[i] * r) : (minend[i] * r);
    ans = max(ans, temp);
  }
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
