Professor Dumbledore is helping Harry destroy the Horcruxes. He went to Gaunt Shack as he suspected a Horcrux to be present there. He saw Marvolo Gaunt's Ring and identified it as a Horcrux. Although he destroyed it, he is still affected by its curse. Professor Snape is helping Dumbledore remove the curse. For this, he wants to give Dumbledore exactly x drops of the potion he made. 

Value of x is calculated as maximum of p·ai + q·aj + r·ak for given p, q, r and array a1, a2, ... an such that 1 ≤ i ≤ j ≤ k ≤ n. Help Snape find the value of x. Do note that the value of x may be negative.

Input

First line of input contains 4 integers n, p, q, r ( - 109 ≤ p, q, r ≤ 109, 1 ≤ n ≤ 105).

Next line of input contains n space separated integers a1, a2, ... an ( - 109 ≤ ai ≤ 109).

Output

Output a single integer the maximum value of p·ai + q·aj + r·ak that can be obtained provided 1 ≤ i ≤ j ≤ k ≤ n.

Examples

Input

5 1 2 3
1 2 3 4 5


Output

30


Input

5 1 2 -3
-1 -2 -3 -4 -5


Output

12

Note

In the first sample case, we can take i = j = k = 5, thus making the answer as 1·5 + 2·5 + 3·5 = 30.

In second sample case, selecting i = j = 1 and k = 5 gives the answer 12.
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
long long maxsum[MAXN][20];
long long minsum[MAXN][20];
long long maxx;
long long minn;
void RMQ_In(int num) {
  for (int j = 1; j < 20; ++j)
    for (int i = 1; i <= num; ++i)
      if (i + (1 << j) - 1 <= num) {
        maxsum[i][j] = max(maxsum[i][j - 1], maxsum[i + (1 << (j - 1))][j - 1]);
        minsum[i][j] = min(minsum[i][j - 1], minsum[i + (1 << (j - 1))][j - 1]);
      }
}
void RMQ_Query(int src, int des) {
  int k = (int)(log(des - src + 1.0) / log(2.0));
  maxx = max(maxsum[src][k], maxsum[des - (1 << k) + 1][k]);
  minn = min(minsum[src][k], minsum[des - (1 << k) + 1][k]);
}
int main() {
  long long ans = 0;
  long long max1;
  int n, p, q, r;
  while (scanf("%d%d%d%d", &n, &p, &q, &r) != EOF) {
    ans = 0;
    max1 = -1e20;
    for (int i = 1; i <= n; i++) {
      scanf("%lld", &minsum[i][0]);
      maxsum[i][0] = minsum[i][0];
    }
    RMQ_In(n);
    for (int i = 1; i <= n; i++) {
      RMQ_Query(1, i);
      ans += minsum[i][0] * q;
      ans += max(p * maxx, p * minn);
      RMQ_Query(i, n);
      ans += max(r * maxx, r * minn);
      max1 = max(max1, ans);
      ans = 0;
    }
    printf("%lld\n", max1);
  }
  return 0;
}
