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