#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, x, mul = 1, ans = 0;
  cin >> n >> k >> x;
  vector<long long> a(n), pref(n, 0), suf(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  while (k) {
    mul *= x;
    k--;
  }
  if (n == 1) {
    cout << a[0] * mul << '\n';
    return 0;
  }
  for (int i = 0; i < n; i++) {
    pref[i] = (i ? pref[i - 1] : 0) | a[i];
  }
  for (int i = n - 1; i >= 0; i--) {
    suf[i] = (i < n - 1 ? suf[i + 1] : 0) | a[i];
  }
  for (int i = 0; i < n; i++) {
    if (!i) {
      ans = max(ans, (a[i] * mul) | suf[i + 1]);
    } else if (i == n - 1) {
      ans = max(ans, (a[i] * mul) | pref[i - 1]);
    } else {
      ans = max(ans, pref[i - 1] | (a[i] * mul) | suf[i + 1]);
    }
  }
  cout << ans << '\n';
  return 0;
}
