#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
long long n, k, x, ans, arr[N], pref[N], suff[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k >> x;
  for (int i = 0; i < n; ++i) cin >> arr[i];
  for (int i = 0; i < n; ++i) {
    pref[i] = arr[i];
    if (i) pref[i] |= pref[i - 1];
  }
  for (int i = n - 1; i >= 0; --i) {
    suff[i] = arr[i];
    if (i + 1 < n) suff[i] |= suff[i + 1];
  }
  for (int i = 0; i < n; ++i) {
    long long left = (i ? pref[i - 1] : 0);
    long long right = (i + 1 < n ? suff[i + 1] : 0);
    long long tmp = arr[i];
    for (int j = 0; j < k; ++j) {
      tmp *= x;
      ans = max(ans, left | right | tmp);
    }
  }
  cout << ans;
  return 0;
}
