#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long a[200000], b[200000], c[200000], x, k, n;
signed main() {
  cin >> n >> k >> x;
  long long val = x;
  for (long long i = 0; i < k - 1; i++) {
    val *= x;
  }
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (i) b[i] = a[i - 1] | b[i - 1];
  }
  long long ans = 0;
  long long cur = 0;
  for (long long i = n - 1; i >= 0; i--) {
    ans = max(ans, (a[i] * val) | cur | b[i]);
    cur |= a[i];
  }
  cout << ans << endl;
  return 0;
}
