#include <bits/stdc++.h>
using namespace std;
const int SIZE = 2e5 + 2;
long long int first[SIZE], last[SIZE], values[SIZE];
void solve() {
  long long int N, K, X;
  cin >> N >> K >> X;
  for (long long int i = 1; i <= N; i++) {
    cin >> values[i];
  }
  long long int _max = 1;
  for (long long int i = 1; i <= K; i++) {
    _max *= X;
  }
  long long int res = 0;
  for (long long int i = 1; i <= N; i++) {
    first[i] = first[i - 1] | values[i];
  }
  for (long long int i = N; i > 0; i--) {
    last[i] = last[i + 1] | values[i];
  }
  for (long long int i = 1; i <= N; i++) {
    long long int cur = first[i - 1] | (values[i] * _max) | last[i + 1];
    res = max(res, cur);
  }
  cout << res << endl;
}
int main() {
  long long int T;
  T = 1;
  while (T-- > 0) {
    solve();
  }
  return 0;
}
