#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, x;
  cin >> n >> k >> x;
  long long mval = 1;
  long long a[n];
  int ind;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < k; i++) mval = mval * x;
  if (n == 1) {
    cout << a[0] * mval << endl;
    return 0;
  }
  long long pre[n];
  pre[0] = a[0];
  for (int i = 1; i < n; i++) pre[i] = a[i] | pre[i - 1];
  long long suf[n];
  suf[n - 1] = a[n - 1];
  for (int i = n - 2; i >= 0; i--) suf[i] = a[i] | suf[i + 1];
  long long ans = (a[0] * mval) | suf[1];
  for (int i = 1; i < n - 1; i++)
    ans = max(ans, pre[i - 1] | (a[i] * mval) | suf[i + 1]);
  ans = max(ans, (a[n - 1] * mval) | pre[n - 2]);
  cout << ans << endl;
  return 0;
}
