#include <bits/stdc++.h>
using namespace std;
long long n, k, x;
long long inp[200005];
long long precom[64][2];
long long num;
long long ans;
int main() {
  cin >> n >> k >> x;
  long long i, j, kl;
  for (i = 0; i < n; ++i) {
    scanf("%lld", &inp[i]);
    for (j = 0; j < 63; ++j) {
      if (((long long)1 << j) & inp[i]) precom[j][0]++;
    }
  }
  long long pos = 0;
  long long ans, tmpans;
  ans = 0;
  for (j = 0; j < n; ++j) {
    num = inp[j];
    for (i = 0; i < k; ++i) {
      num *= x;
    }
    for (kl = 0; kl < 64; ++kl) {
      precom[kl][1] = 0;
      if ((num & ((long long)1 << kl)) && !(inp[j] & ((long long)1 << kl))) {
        precom[kl][1] = 1;
      }
      if (!(num & ((long long)1 << kl)) && (inp[j] & ((long long)1 << kl)))
        precom[kl][1] = -1;
    }
    tmpans = 0;
    for (kl = 0; kl < 64; ++kl) {
      if (precom[kl][0] + precom[kl][1]) tmpans += ((long long)1 << kl);
    }
    if (tmpans > ans) {
      ans = tmpans;
    }
  }
  cout << ans << endl;
}
