#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, x, k, mult = 1;
  cin >> n >> k >> x;
  while (k--) {
    mult *= x;
  }
  vector<long long> pre(n + 1, 0), suf(n + 2, 0), v(n + 1, 0);
  for (long long i = 1; i <= n; i++) {
    cin >> v[i];
    pre[i] = pre[i - 1] | v[i];
  }
  for (long long i = n; i >= 1; i--) suf[i] = suf[i + 1] | v[i];
  long long ans = 0;
  for (long long i = 1; i <= n; i++)
    ans = max(ans, pre[i - 1] | (mult * v[i]) | suf[i + 1]);
  cout << ans;
  return 0;
}
