#include <bits/stdc++.h>
using namespace std;
long long int arr[200009];
long long int lef[200009], rit[200009];
int main() {
  int i, j, n, k, x;
  cin >> n >> k >> x;
  for (i = 1; i <= n; i++) scanf("%I64d", &arr[i]);
  long long int val = 1;
  for (i = 0; i < k; i++) val *= x;
  long long int ans = 0;
  lef[1] = 0;
  for (i = 1; i <= n; i++) lef[i + 1] = lef[i] | arr[i];
  rit[n] = 0;
  for (i = n; i >= 1; i--) rit[i - 1] = rit[i] | arr[i];
  for (i = 1; i <= n; i++) {
    ans = max(ans, lef[i] | (rit[i] | arr[i] * val));
  }
  cout << ans;
  return 0;
}
