#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 110;
long long a[N];
long long dp1[N];
long long dp2[N];
int main() {
  long long n, k, x;
  while (cin >> n >> k >> x) {
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    long long pow = 1;
    for (int i = 1; i <= k; i++) pow *= x;
    dp1[0] = 0;
    for (int i = 1; i <= n; i++) dp1[i] = dp1[i - 1] | a[i - 1];
    dp2[n] = 0;
    for (int i = n - 1; i >= 0; i--) dp2[i] = dp2[i + 1] | a[i];
    long long ret = 0;
    for (int i = 0; i < n; i++)
      ret = max(ret, dp1[i] | (a[i] * pow) | dp2[i + 1]);
    cout << ret << endl;
  }
  return 0;
}
