#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long p[200020];
long long s[200020], e[200020];
int main() {
  int n, k, x;
  cin >> n >> k >> x;
  for (int i = 1; i <= n; i++) cin >> p[i];
  s[0] = 0;
  for (int i = 1; i <= n; i++) {
    s[i] = s[i - 1] | p[i];
  }
  e[n + 1] = 0;
  for (int i = n; i >= 1; i--) {
    e[i] = e[i + 1] | p[i];
  }
  long long ans = e[1];
  for (int i = 1; i <= n; i++) {
    long long tmp = p[i];
    for (int j = 0; j < k; j++) {
      tmp *= x;
    }
    ans = max(ans, s[i - 1] | tmp | e[i + 1]);
  }
  cout << ans << endl;
}
