#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  long long n, k, x;
  cin >> n >> k >> x;
  long long mult = 1;
  while (k--) mult *= x;
  vector<long long> a(n + 2), pref(n + 2, 0), suff(n + 2, 0);
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    pref[i] |= a[i];
    pref[i] |= pref[i - 1];
  }
  for (long long i = n; i > 0; i--) suff[i] = suff[i + 1] | a[i];
  long long ans = 0;
  for (long long i = 1; i <= n; i++)
    ans = max(ans, (suff[i + 1] | pref[i - 1]) | (a[i] * mult));
  cout << ans;
}
