#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200010;
int64_t N, K, X;
int64_t arr[MAXN], prefix[MAXN], suffix[MAXN];
void precalc() {
  for (int i = 1; i <= N; i++) {
    prefix[i] = prefix[i - 1] | arr[i];
  }
  for (int i = N; i >= 1; i--) {
    suffix[i] = suffix[i + 1] | arr[i];
  }
}
int64_t raise(int64_t base, int64_t exponent) {
  int64_t rs = base;
  for (int i = 1; i < exponent; i++) rs *= base;
  return rs;
}
int main() {
  cin >> N >> K >> X;
  for (int i = 1; i <= N; i++) cin >> arr[i];
  int ind = 0;
  for (int step = 1; step <= 1; step++) {
    precalc();
    int64_t sum = prefix[N];
    for (int i = 1; i <= N; i++) {
      int64_t newSum = prefix[i - 1] | (arr[i] * raise(X, K)) | suffix[i + 1];
      if (newSum > sum) {
        sum = newSum;
        ind = i;
      }
    }
    arr[ind] *= raise(X, K);
  }
  precalc();
  cout << prefix[N];
  return 0;
}
