#include <bits/stdc++.h>
using namespace std;
inline long long max(long long a, long long b) { return a > b ? a : b; }
int a[200000 + 5], n, k, x;
int l[200000 + 5], r[200000 + 5];
long long ans;
long long Pow(long long n, int k) {
  long long res = 1;
  while (k) {
    if (k & 1) res *= n;
    n *= n;
    k >>= 1;
  }
  return res;
}
int main() {
  int i;
  scanf("%d%d%d", &n, &k, &x);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    l[i] = l[i - 1] | a[i];
  }
  for (i = n; i >= 1; i--) r[i] = r[i + 1] | a[i];
  for (i = 1; i <= n; i++)
    ans = max(ans, l[i - 1] | a[i] * Pow(x, k) | r[i + 1]);
  printf("%I64d\n", ans);
}
