#include <bits/stdc++.h>
using namespace std;
long long ar[200004], pre[200004], suf[200004];
int main() {
  int n, k, x, i;
  cin >> n >> k >> x;
  long long pro = 1;
  while (k--) {
    pro *= x;
  }
  for (i = 1; i <= n; i++) {
    scanf("%I64d", &ar[i]);
  }
  for (i = 1; i <= n; i++) {
    pre[i] = pre[i - 1] | ar[i];
  }
  for (i = n; i > 0; i--) {
    suf[i] = suf[i + 1] | ar[i];
  }
  long long ans = 0;
  for (i = 1; i <= n; i++) {
    long long now = pre[i - 1] | (ar[i] * pro) | suf[i + 1];
    ans = max(ans, now);
  }
  printf("%I64d\n", ans);
  return 0;
}
