#include <bits/stdc++.h>
using namespace std;
long long a[200002], dp1[200002], dp2[200002], ans, t;
int x, n, k, s;
int main() {
  int i;
  while (cin >> n >> k >> x) {
    for (i = 1; i <= n; i++) cin >> a[i];
    s = 1;
    for (i = 1; i <= k; i++) s *= x;
    dp1[1] = a[1];
    dp2[1] = a[n];
    for (i = 2; i <= n; i++) dp1[i] = dp1[i - 1] | a[i];
    for (i = 2; i <= n; i++) dp2[i] = dp2[i - 1] | a[n - i + 1];
    ans = 0;
    for (i = 1; i <= n; i++) {
      t = dp1[i - 1] | dp2[n - i] | (a[i] * s);
      if (t > ans) ans = t;
    }
    cout << ans;
  }
  return 0;
}
