#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return !b ? a : gcd(b, a % b); }
int abs(int a) {
  if (a < 0) return -a;
  return a;
}
int main() {
  long long n, k, x, aux;
  cin >> n >> k >> x;
  aux = 1;
  for (int i = 0; i < k; i++) aux *= x;
  x = aux;
  long long a[n], pref[n], suff[n], sol = 0;
  for (int i = 0; i < n; i++) cin >> a[i];
  pref[0] = 0;
  for (int i = 1; i < n; i++) pref[i] = pref[i - 1] | a[i - 1];
  suff[n - 1] = 0;
  for (int i = n - 2; i >= 0; i--) suff[i] = suff[i + 1] | a[i + 1];
  for (int i = 0; i < n; i++) a[i] *= x;
  for (int i = 0; i < n; i++) sol = max(sol, pref[i] | suff[i] | a[i]);
  cout << sol << endl;
}
