#include <bits/stdc++.h>
using namespace std;
long long n, k, x;
vector<long long> a;
constexpr long long maxN = 2e5 + 43;
long long pref[maxN];
long long suff[maxN];
signed main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> k >> x;
  a.resize(n + 1);
  for (long long i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  long long maxx = -1;
  for (long long j = 1; j <= k; ++j) {
    long long comp = (long long)pow(x, j);
    for (long long i = 1; i <= n; ++i) {
      pref[i] = (pref[i - 1] | a[i]);
    }
    for (long long i = n; i >= 1; --i) {
      suff[i] = (suff[i + 1] | a[i]);
    }
    for (long long i = 1; i <= n; ++i) {
      long long c = a[i] * comp;
      maxx = max(maxx, (pref[i - 1] | c) | suff[i + 1]);
    }
  }
  cout << maxx;
  return 0;
}
