#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, x;
  long long maxi = -1;
  cin >> n >> k >> x;
  x = pow(x, k);
  vector<int> pv(n + 2, 0);
  vector<int> v(n + 2, 0);
  vector<int> sv(n + 2, 0);
  for (int i = 1; i <= n; i++) {
    int nr;
    cin >> nr;
    v[i] = nr;
  }
  for (int i = 1; i <= n; i++) {
    pv[i] = v[i] | pv[i - 1];
  }
  for (int i = n; i >= 1; i--) {
    sv[i] = v[i] | sv[i + 1];
  }
  for (int i = 1; i <= n; i++) {
    maxi = max(maxi, (pv[i - 1] | (v[i] * x) | sv[i + 1]));
  }
  cout << maxi;
  return 0;
}
