#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
long long a[N], b[N], c[N];
int main() {
  long long n, k, x;
  scanf("%lld%lld%lld", &n, &k, &x);
  long long t = 1;
  while (k--) t *= x;
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    b[i] = b[i - 1] | a[i];
  }
  for (int i = n; i >= 1; i--) c[i] = c[i + 1] | a[i];
  long long ans = 0;
  for (int i = 1; i <= n; i++) ans = max(ans, b[i - 1] | (a[i] * t) | c[i + 1]);
  printf("%lld\n", ans);
  return 0;
}
