#include <bits/stdc++.h>
using namespace std;
const unsigned long long M = 998244353;
void solve() {
  long long n, k, x;
  cin >> n >> k >> x;
  vector<long long> arr(n);
  for (long long i = 0; i < n; i++) cin >> arr[i];
  long long val = 1;
  while (k--) val *= x;
  long long pre[n + 1], suf[n + 1];
  pre[0] = 0, suf[n] = 0;
  for (long long i = 1; i <= n; i++) pre[i] = pre[i - 1] | arr[i - 1];
  for (long long i = n - 1; i >= 0; i--) suf[i] = suf[i + 1] | arr[i];
  long long maxx = 0;
  for (long long i = 0; i < n; i++) {
    maxx = max(maxx, pre[i] | val * arr[i] | suf[i + 1]);
  }
  cout << maxx << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
}
