#include <bits/stdc++.h>
using namespace std;
long long xx[200005];
int n, k;
long long x;
long long lef[200005];
long long righ[200005];
int main(void) {
  scanf("%d%d%lld", &n, &k, &x);
  for (int i = 1; i <= n; i++) scanf("%lld", &xx[i]);
  long long temp = 1;
  for (int i = 1; i <= k; i++) {
    temp = temp * (long long)x;
  }
  memset(lef, 0, sizeof(lef));
  memset(righ, 0, sizeof(righ));
  for (int i = 1; i <= n; i++) lef[i] = lef[i - 1] | xx[i];
  for (int i = n; i >= 1; i--) righ[i] = righ[i + 1] | xx[i];
  long long ans = 0;
  for (int i = 1; i <= n; i++)
    ans = max(ans, (xx[i] * temp) | lef[i - 1] | righ[i + 1]);
  printf("%lld\n", ans);
  return 0;
}
