#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, x;
  cin >> n >> k >> x;
  vector<long long> num(n + 2), prefix(n + 2, 0), suffix(n + 2, 0);
  for (int i = 1; i <= n; i++) {
    cin >> num[i];
  }
  for (int i = 1; i <= n; i++) {
    prefix[i] = prefix[i - 1] | num[i];
  }
  for (int i = n; i >= 1; i--) {
    suffix[i] = suffix[i + 1] | num[i];
  }
  long long b = x;
  for (int i = 1; i < k; i++) b *= x;
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = max(ans, prefix[i - 1] | (num[i] * b) | suffix[i + 1]);
  }
  cout << ans << '\n';
  return 0;
}
