#include <bits/stdc++.h>
using namespace std;
const long long LLINF = 1ll << 60;
const int N = 2e5 + 4;
long long a[N], pref[N], suf[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << setprecision(25);
  int T = 1;
  while (T--) {
    int n, k, x;
    cin >> n >> k >> x;
    for (int i = 1; i <= n; i++) cin >> a[i];
    long long num = 1;
    while (k--) num *= x;
    for (int i = 1; i <= n; i++) pref[i] = pref[i - 1] | a[i];
    for (int i = n; i > 0; 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] * num) | suf[i + 1]);
    }
    cout << ans << "\n";
  }
}
