#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, k, x;
  cin >> n >> k >> x;
  x = pow(x, k);
  long long pre[n], suf[n], a[n];
  pre[0] = 0;
  suf[n - 1] = 0;
  for (long long i = (long long)0; i != (long long)n; i = i + 1) cin >> a[i];
  for (long long i = (long long)0; i != (long long)n - 1; i = i + 1)
    pre[i + 1] = pre[i] | a[i];
  for (long long i = (long long)n - 1; i != (long long)0; i = i + -1)
    suf[i - 1] = suf[i] | a[i];
  long long ans = 0;
  for (long long i = (long long)0; i != (long long)n; i = i + 1) {
    ans = max(ans, pre[i] | a[i] * x | suf[i]);
  }
  cout << ans << '\n';
}
