#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long int n, k, x, i, j;
  cin >> n >> k >> x;
  unsigned long long int a[n + 1];
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  unsigned long long int xk = 1;
  for (i = 1; i <= k; i++) xk *= x;
  unsigned long long int pre[n + 1];
  unsigned long long int suf[n + 2];
  pre[0] = 0;
  pre[1] = a[1];
  suf[n] = a[n];
  for (i = 2; i <= n; i++) pre[i] = pre[i - 1] | a[i];
  for (i = n - 1; i >= 1; i--) suf[i] = suf[i + 1] | a[i];
  unsigned long long int ans = 0;
  suf[n + 1] = 0;
  for (i = 1; i <= n; i++) {
    ans = max(ans, pre[i - 1] | (a[i] * xk) | suf[i + 1]);
  }
  ans = max(ans, pre[n]);
  cout << ans << '\n';
  return 0;
}
