#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
long long n, k, x;
long long a[N], pref[N], suf[N];
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> k >> x;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    pref[i] = pref[i - 1] | a[i];
  }
  for (long long i = n; i >= 1; i--) suf[i] |= suf[i + 1] | a[i];
  long long val = 1;
  for (long long i = 1; i <= k; i++) val *= x;
  long long ans = 0;
  for (long long i = 1; i <= n; i++)
    ans = max(ans, pref[i - 1] | a[i] * val | suf[i + 1]);
  cout << ans;
  return 0;
}
