#include <bits/stdc++.h>
long long n, k, x, m = 1, s, mx;
long long a[200005], b[2000005], c[200005];
int main() {
  int i;
  scanf("%d%d%d", &n, &k, &x);
  for (i = 0; i < k; i++) m *= x;
  for (i = 1; i <= n; i++) scanf("%d", &a[i]), b[i] = b[i - 1] | a[i];
  for (i = n; i >= 1; i--) c[i] = c[i + 1] | a[i];
  for (i = 1; i <= n; i++) {
    s = b[i - 1] | a[i] * m | c[i + 1];
    if (s > mx) mx = s;
  }
  printf("%I64d", mx);
  return 0;
}
