#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, x, m;
  cin >> n >> k >> x;
  vector<long long> V(n + 10), P(n + 10, 0), S(n + 10, 0);
  for (int i = 1; i <= n; ++i) {
    cin >> V[i];
  }
  m = 1;
  while (k--) m *= x;
  for (int i = 1; i <= n; i++) P[i] = P[i - 1] | V[i];
  for (int j = n; j > 0; j--) S[j] = S[j + 1] | V[j];
  long long ans = 0;
  for (int i = 1; i <= n; ++i) ans = max(ans, P[i - 1] | (V[i] * m) | S[i + 1]);
  cout << ans << '\n';
  return 0;
}
