#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, k, x, i, ans = 0;
  cin >> n >> k >> x;
  long long a[n], pre[n + 1], suf[n + 1];
  for (i = 0; i < n; i++) cin >> a[i];
  pre[0] = 0, suf[n] = 0;
  for (i = 1; i <= n; i++)
    pre[i] = pre[i - 1] | a[i - 1], suf[n - i] = suf[n - i + 1] | a[n - i];
  long long val = 1;
  for (i = 0; i < k; i++) val *= x;
  for (i = 0; i < n; i++) ans = max(ans, pre[i] | val * a[i] | suf[i + 1]);
  cout << ans << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
