#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n, x, k;
ll arr[200001];
int main() {
  scanf("%d%d%d", &n, &k, &x);
  vector<ll> v1(n + 2), v2(n + 2);
  for (int i = 1; i <= n; ++i) {
    scanf("%lld", &arr[i]);
    v1[i] = arr[i] | v1[i - 1];
  }
  for (int i = n; ~i; --i) {
    v2[i] = arr[i] | v2[i + 1];
  }
  ll d = 1;
  while (k--) {
    d *= x;
  }
  ll ans = 0;
  for (int i = 1; i <= n; ++i) {
    ans = max(ans, v1[i - 1] | arr[i] * d | v2[i + 1]);
  }
  printf("%lld\n", ans);
  return 0;
}
