#include <bits/stdc++.h>
int n, k, x;
long long a[200200], C, b[200200], c[200200], ans;
int main() {
  scanf("%d%d%d", &n, &k, &x);
  for (int i = 0; i < n; i++) scanf("%I64d", a + i);
  C = 1;
  while (k--) C *= x;
  b[0] = a[0];
  c[n - 1] = a[n - 1];
  for (int i = 1; i < n; i++) b[i] = a[i] | b[i - 1];
  for (int i = n - 2; i >= 0; i--) c[i] = c[i + 1] | a[i];
  for (int i = 0; i < n; i++) {
    long long tp = 0;
    if (i) tp |= b[i - 1];
    if (i < n - 1) tp |= c[i + 1];
    tp |= a[i] * C;
    if (ans < tp) ans = tp;
  }
  printf("%I64d\n", ans);
  return 0;
}
