#include <bits/stdc++.h>
using namespace std;
const long long INF = (long long)2e10 + 1000;
const double Pi = 3.1415926535;
long long a[200005];
long long pref[200005];
long long suf[200005];
int main() {
  long long n, k, x;
  long long mol = 1;
  cin >> n >> k >> x;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= k; i++) {
    mol *= x;
  }
  for (int i = 1; i <= n; i++) {
    pref[i] = pref[i - 1] | a[i];
  }
  for (int i = n; i >= 1; i--) {
    suf[i] = suf[i + 1] | a[i];
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = max(ans, pref[i - 1] | (a[i] * mol) | suf[i + 1]);
  }
  cout << ans << '\n';
}
