#include <bits/stdc++.h>
using namespace std;
void solve(int n) {
  int k, x;
  cin >> k >> x;
  vector<int> a(n);
  for (int i = 0; i < n; i++) scanf(" %d", &a[i]);
  vector<int> pref(n), suf(n);
  for (int i = 0; i < n; i++) pref[i] = (a[i] | (i == 0 ? 0 : pref[i - 1]));
  for (int i = n - 1; i >= 0; i--)
    suf[i] = (a[i] | (i == n - 1 ? 0 : suf[i + 1]));
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    long long cur = a[i];
    for (int j = 0; j < k; j++) cur *= x;
    cur |= (i == 0 ? 0 : pref[i - 1]);
    cur |= (i == n - 1 ? 0 : suf[i + 1]);
    ans = max(ans, cur);
  }
  cout << ans << endl;
}
int main() {
  int n;
  while (cin >> n) solve(n);
}
