#include <bits/stdc++.h>
using namespace std;
long long a[200010];
long long pre[200010];
long long post[200010];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, k, x;
  cin >> n >> k >> x;
  for (int i = 1; i <= n; i++) cin >> a[i];
  long long ans = 0;
  long long xk = 1;
  for (int i = 0; i < k; i++) xk *= x;
  pre[0] = 0;
  for (int i = 1; i <= n + 1; i++) {
    pre[i] = (pre[i - 1] | a[i]);
  }
  post[n + 1] = 0;
  for (int i = n; i >= 0; i--) {
    post[i] = (post[i + 1] | a[i]);
  }
  for (int i = 1; i <= n; i++) {
    ans = max(ans, (pre[i - 1] | (a[i] * xk) | post[i + 1]));
  }
  cout << ans << '\n';
}
