#include <bits/stdc++.h>
using namespace std;
long long tree[4 * 2000005 + 1];
long long a[2000005];
void build(long long idx, long long second, long long se) {
  if (se == second) {
    tree[idx] = a[second];
    return;
  }
  long long mid = (second + se) / 2;
  build(2 * idx, second, mid);
  build(2 * idx + 1, mid + 1, se);
  tree[idx] = tree[2 * idx] | tree[2 * idx + 1];
}
void update(long long idx, long long second, long long se, long long q,
            long long val) {
  if (q < second || q > se) return;
  if (second == se) {
    tree[idx] = val;
    return;
  }
  long long mid = (second + se) / 2;
  if (q <= mid)
    update(2 * idx, second, mid, q, val);
  else
    update(2 * idx + 1, mid + 1, se, q, val);
  tree[idx] = tree[2 * idx] | tree[2 * idx + 1];
}
void solve() {
  long long n, k, x;
  cin >> n >> k >> x;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  long long y = pow(x, k);
  long long ans = 0;
  build(1, 1, n);
  for (long long i = 1; i <= n; i++) {
    update(1, 1, n, i, a[i] * y);
    ans = max(tree[1], ans);
    update(1, 1, n, i, a[i]);
  }
  cout << ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long tc = 1;
  while (tc--) {
    solve();
  }
}
