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