#include <bits/stdc++.h>
long long a[200010], l[200010], r[200010];
int main() {
  int n;
  long long k, x, tmp = 1;
  scanf("%d%I64d%I64d", &n, &k, &x);
  while (k--) tmp *= x;
  for (int i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  l[0] = 0;
  for (int i = 1; i <= n; i++) l[i] = l[i - 1] | a[i];
  r[n + 1] = 0;
  for (int i = n; i >= 1; i--) r[i] = r[i + 1] | a[i];
  long long ans = -1;
  for (int i = 1; i <= n; i++) {
    ans = ans > ((tmp * a[i]) | l[i - 1] | r[i + 1])
              ? ans
              : ((tmp * a[i]) | l[i - 1] | r[i + 1]);
  }
  printf("%I64d\n", ans);
  return 0;
}
