#include <bits/stdc++.h>
using namespace std;
unsigned long long n, k, x, l[200100];
unsigned long long accl[200100], accr[200100];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k >> x;
  for (int i = 1; i <= n; i++) {
    cin >> l[i];
    accl[i] = accl[i - 1] | l[i];
  }
  for (int i = n; i > 0; i--) {
    accr[i] = accr[i + 1] | l[i];
  }
  unsigned long long pot = 1ull;
  for (int i = 1; i <= k; i++) pot *= x;
  unsigned long long sol = 0;
  for (int i = 1; i <= n; i++) {
    sol = max(sol, accl[i - 1] | (l[i] * pot) | accr[i + 1]);
  }
  cout << sol << endl;
}
