#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, a1, a2, a3, a = -8e18, b = -8e18, c = -8e18;
  cin >> n >> a1 >> a2 >> a3;
  int x;
  for (int i = 0; i < n; i++) {
    cin >> x;
    a = max(a, a1 * x);
    b = max(b, a + a2 * x);
    c = max(c, b + a3 * x);
  }
  cout << c << endl;
}
