#include <bits/stdc++.h>
using namespace std;
template <class T1>
void deb(T1 e1) {
  cout << e1 << endl;
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << endl;
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << endl;
}
template <class T1, class T2, class T3, class T4>
void deb(T1 e1, T2 e2, T3 e3, T4 e4) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << endl;
}
template <class T1, class T2, class T3, class T4, class T5>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << endl;
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6
       << endl;
}
long long arr[200000 + 7], lft[200000 + 7], rgt[200000 + 7], n, k, x;
long long POW(long long a, long long b) {
  long long ans = 1;
  for (int i = 1; i <= b; i++) ans *= a;
  return ans;
}
int main() {
  scanf("%lld %lld", &n, &k);
  scanf("%lld", &x);
  long long p = 0;
  x = POW(x, k);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &arr[i]);
    p |= arr[i];
    if (i)
      lft[i] = arr[i] | lft[i - 1];
    else
      lft[i] = arr[i];
  }
  for (int i = n - 1; i >= 0; i--) {
    if (i == n - 1)
      rgt[i] = arr[i];
    else
      rgt[i] = arr[i] | rgt[i + 1];
    if (i < n - 1 and i) {
      p = max(p, lft[i - 1] | (arr[i] * x) | rgt[i + 1]);
    } else if (i == n - 1 and i) {
      p = max(p, lft[i - 1] | (arr[i] * x));
    } else if (i == 0 and n > 1)
      p = max(p, (arr[i] * x) | rgt[i + 1]);
    else
      p = max(p, arr[i] * x);
  }
  long long ans = p;
  deb(ans);
  return 0;
}

### Prompt

Your task is to create a Cpp solution to the following problem:

You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make <image> as large as possible, where <image> denotes the bitwise OR. 

Find the maximum possible value of <image> after performing at most k operations optimally.

Input

The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8).

The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).

Output

Output the maximum value of a bitwise OR of sequence elements after performing operations.

Examples

Input

3 1 2
1 1 1


Output

3


Input

4 2 3
1 2 4 8


Output

79

Note

For the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is <image>. 

For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
template <class T1>
void deb(T1 e1) {
  cout << e1 << endl;
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << endl;
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << endl;
}
template <class T1, class T2, class T3, class T4>
void deb(T1 e1, T2 e2, T3 e3, T4 e4) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << endl;
}
template <class T1, class T2, class T3, class T4, class T5>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << endl;
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6
       << endl;
}
long long arr[200000 + 7], lft[200000 + 7], rgt[200000 + 7], n, k, x;
long long POW(long long a, long long b) {
  long long ans = 1;
  for (int i = 1; i <= b; i++) ans *= a;
  return ans;
}
int main() {
  scanf("%lld %lld", &n, &k);
  scanf("%lld", &x);
  long long p = 0;
  x = POW(x, k);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &arr[i]);
    p |= arr[i];
    if (i)
      lft[i] = arr[i] | lft[i - 1];
    else
      lft[i] = arr[i];
  }
  for (int i = n - 1; i >= 0; i--) {
    if (i == n - 1)
      rgt[i] = arr[i];
    else
      rgt[i] = arr[i] | rgt[i + 1];
    if (i < n - 1 and i) {
      p = max(p, lft[i - 1] | (arr[i] * x) | rgt[i + 1]);
    } else if (i == n - 1 and i) {
      p = max(p, lft[i - 1] | (arr[i] * x));
    } else if (i == 0 and n > 1)
      p = max(p, (arr[i] * x) | rgt[i + 1]);
    else
      p = max(p, arr[i] * x);
  }
  long long ans = p;
  deb(ans);
  return 0;
}

```