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;
int _I() {
  int x;
  scanf("%d", &x);
  return x;
}
long long _L() {
  long long x;
  scanf("%lld", &x);
  return x;
}
long long gcd(long long a, long long b) {
  while (b) b ^= a ^= b ^= a %= b;
  return a;
}
long long lcm(long long x, long long y) {
  x /= gcd(x, y);
  return x * y;
}
int kdx[8] = {-2, -2, -1, -1, 1, 1, 2, 2};
int kdy[8] = {-1, 1, -2, 2, -2, 2, -1, 1};
bool prime[2];
vector<int> v;
void sieve() {
  int i, j;
  prime[1] = 1;
  v.push_back(2);
  for (i = 4; i <= 100007; i += 2) prime[i] = 1;
  for (i = 3; i <= 100007; i += 2)
    if (!prime[i]) {
      v.push_back(i);
      for (j = i + i + i; j <= 100007; j += i + i) prime[j] = 1;
    }
}
bool chk(long long n, long long m) {
  if (n < 3) return 1;
  long long a = n * (n - 1);
  return a == m;
}
bool inrng(int x, int y, int c) { return (x <= c && c <= y); }
bool inRng(int a, int b, int x, int y) {
  return (inrng(a, b, x) || inrng(a, b, y) || inrng(x, y, a) || inrng(x, y, b));
}
map<int, int> mp1;
long long ar[100007];
long long dp[100007][3];
bool vis[100007][3];
long long p, q, r;
long long game(int idx, int pos) {
  if (idx == 0) {
    if (vis[idx][pos]) return dp[idx][pos];
    vis[idx][pos] = 1;
    if (pos == 0) {
      dp[idx][pos] = (p * ar[idx]) + (q * ar[idx]) + (r * ar[idx]);
      return dp[idx][pos];
    }
    if (pos == 1) {
      dp[idx][pos] = (q * ar[idx]) + (r * ar[idx]);
      return dp[idx][pos];
    } else {
      dp[idx][pos] = r * ar[idx];
      return dp[idx][pos];
    }
  }
  if (vis[idx][pos]) return dp[idx][pos];
  vis[idx][pos] = 1;
  if (pos == 0) {
    dp[idx][pos] =
        max(game(idx - 1, pos), ((p * ar[idx]) + game(idx, pos + 1)));
    return dp[idx][pos];
  }
  if (pos == 1) {
    dp[idx][pos] =
        max(game(idx - 1, pos), ((q * ar[idx]) + game(idx, pos + 1)));
    return dp[idx][pos];
  }
  if (pos == 2) {
    dp[idx][pos] = max(game(idx - 1, pos), (r * ar[idx]));
    return dp[idx][pos];
  }
}
void lipu_mira() {
  long long i, j, n;
  n = _L();
  p = _L();
  q = _L();
  r = _L();
  for (i = n - 1; i > -1; i--) {
    ar[i] = _L();
  }
  printf("%lld", game(n - 1, 0));
}
int main() {
  lipu_mira();
  return 0;
}
