#include <bits/stdc++.h>
using namespace std;
const long long maxn = 2e5 + 5;
long long n, m, x, y, z;
long long a[maxn], f[maxn], ff[maxn], g[maxn], gg[maxn];
const long long inf = 4e18;
int main() {
  cin >> n >> x >> y >> z;
  for (register long long i = 1; i <= n; ++i) cin >> a[i];
  for (register long long i = 0; i <= n + 1; ++i)
    gg[i] = g[i] = inf, ff[i] = f[i] = -inf;
  for (register long long i = 1; i <= n; ++i)
    f[i] = max(f[i - 1], a[i]), g[i] = min(g[i - 1], a[i]);
  for (register long long i = n; i >= 1; --i)
    ff[i] = max(ff[i + 1], a[i]), gg[i] = min(gg[i + 1], a[i]);
  long long ans = -inf;
  for (register long long i = 1; i <= n; ++i) {
    long long tmp = a[i] * y;
    if (x > 0)
      tmp += f[i] * x;
    else
      tmp += g[i] * x;
    if (z > 0)
      tmp += ff[i] * z;
    else
      tmp += gg[i] * z;
    ans = max(ans, tmp);
  }
  cout << ans << endl;
  return 0;
}
