#include <bits/stdc++.h>
long long a[200011], pf[200011], sf[200011];
int main() {
  int n, k, x, i, j;
  long long r = 0, t;
  scanf("%d %d %d", &n, &k, &x);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (i = 1; i <= n; i++) pf[i] = pf[i - 1] | a[i];
  for (i = n; i >= 1; i--) sf[i] = sf[i + 1] | a[i];
  for (i = 1; i <= n; i++) {
    t = a[i];
    for (j = 1; j <= k; j++) t = t * x;
    t = t | pf[i - 1] | sf[i + 1];
    if (r < t) r = t;
  }
  printf("%I64d", r);
  return 0;
}
