#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
long long suff[maxn], pre[maxn], base, a[maxn];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n, k, x;
  cin >> n >> k >> x;
  base = x;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    pre[i] = (pre[i - 1] | a[i]);
  }
  for (int i = n; i >= 1; --i) {
    suff[i] = (suff[i + 1] | a[i]);
  }
  long long maxi = 0;
  long long pw = 1;
  for (int i = 1; i <= k; ++i) {
    pw *= x;
  }
  maxi = pre[n];
  for (int i = 1; i <= n; ++i) {
    long long cterm = (pre[i - 1] | suff[i + 1]);
    cterm |= (pw * a[i]);
    maxi = max(maxi, cterm);
  }
  cout << maxi << "\n";
  return 0;
}
