#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
long long a[N], p[N], s[N];
long long ans = 0;
int n, k, x;
signed main() {
  cin >> n >> k >> x;
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n; ++i) {
    p[i] = (i ? p[i - 1] | a[i] : a[i]);
  }
  for (int i = n - 1; i >= 0; --i) {
    s[i] = ((i == n - 1) ? a[i] : s[i + 1] | a[i]);
  }
  long long mx = 1;
  while (k--) mx *= 1LL * x;
  for (int i = 0; i < n; ++i) {
    long long tmp = a[i] * mx;
    ans = max(ans, (i ? p[i - 1] : 0) | tmp | (i == n - 1 ? 0 : s[i + 1]));
  }
  cout << ans;
}
