#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
const int N = 2e5;
int n, k, x;
int32_t a[N], l, r[N + 1];
int64_t xk = 1, ans;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout << fixed;
  cin >> n >> k >> x;
  for (int i = 0; i < n; i++) cin >> a[i];
  while (k-- > 0) xk *= x;
  for (int i = n - 1; i >= 0; i--) r[i] = r[i + 1] | a[i];
  for (int i = 0; i < n; i++) {
    ans = max(ans, xk * a[i] | l | r[i + 1]);
    l |= a[i];
  }
  cout << ans << endl;
  return 0;
}
