#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200005;
int arr[MAXN];
int suff[MAXN], pref[MAXN];
int n, k, x;
int main() {
  cin >> n >> k >> x;
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
  }
  pref[0] = arr[0];
  for (int i = 1; i < n; i++) {
    pref[i] = pref[i - 1] | arr[i];
  }
  suff[n - 1] = arr[n - 1];
  for (int i = n - 2; i >= 0; i--) {
    suff[i] = suff[i + 1] | arr[i];
  }
  if (n == 1) {
    long long odg = arr[0];
    for (int i = 0; i < k; i++) {
      odg *= x;
    }
    cout << odg << endl;
    return 0;
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    long long novi = arr[i];
    for (int j = 0; j < k; j++) novi *= x;
    if (i == 0) {
      ans = max(ans, novi | suff[1]);
    } else if (i == n - 1)
      ans = max(ans, novi | pref[n - 2]);
    else
      ans = max(ans, (novi | suff[i + 1]) | pref[i - 1]);
  }
  cout << ans << endl;
  return 0;
}
