#include <bits/stdc++.h>
int main() {
  static int aa[200000], pp[200000], qq[200000];
  int n, k, i, p, q;
  long long x, xk, ans, a;
  scanf("%d%d%lld", &n, &k, &x);
  for (i = 0; i < n; i++) scanf("%d", &aa[i]);
  for (i = 0, p = 0; i < n; i++) {
    pp[i] = p;
    p |= aa[i];
  }
  for (i = n - 1, q = 0; i >= 0; i--) {
    qq[i] = q;
    q |= aa[i];
  }
  xk = 1;
  while (k--) xk *= x;
  ans = 0;
  for (i = 0; i < n; i++)
    if (ans < (a = pp[i] | aa[i] * xk | qq[i])) ans = a;
  printf("%lld\n", ans);
  return 0;
}
