#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long n, k, x;
  cin >> n >> k >> x;
  vector<unsigned long long> q(n), a(n), b(n);
  for (int i = 0; i < n; i++) {
    cin >> q[i];
    if (i == 0)
      a[0] = q[i];
    else
      a[i] = q[i] | a[i - 1];
  }
  for (int i = n - 1; i >= 0; i--) {
    if (i == n - 1)
      b[n - 1] = q[n - 1];
    else
      b[i] = q[i] | b[i + 1];
  }
  unsigned long long xk = 1;
  for (int i = 0; i < k; i++) {
    xk *= x;
  }
  unsigned long long maxx = 0;
  if (n == 1) {
    cout << q[0] * xk;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    if (i == 0) {
      maxx = max(maxx, b[1] | (xk * q[0]));
    } else if (i == n - 1) {
      maxx = max(maxx, a[n - 2] | (q[n - 1] * xk));
    } else {
      maxx = max(maxx, a[i - 1] | (q[i] * xk) | b[i + 1]);
    }
  }
  cout << maxx;
  return 0;
}
