#include <bits/stdc++.h>
using namespace std;
unsigned long long mod_pow(unsigned long long num, unsigned long long pow,
                           unsigned long long mod) {
  unsigned long long test;
  unsigned long long n = num;
  for (test = 1; pow; pow >>= 1) {
    if (pow & 1) test = ((test % mod) * (n % mod)) % mod;
    n = ((n % mod) * (n % mod)) % mod;
  }
  return test;
}
long long gcd(long long a, long long b) {
  long long r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
long long left1[200005];
long long right1[200005];
long long arr[200005];
int main() {
  int n, k, x;
  scanf("%d", &n);
  scanf("%d", &k);
  scanf("%d", &x);
  long long mul = 1;
  for (int i = 0; i < k; ++i) mul *= x;
  for (int i = 0; i < n; ++i) scanf("%lld", &arr[i + 1]);
  left1[1] = arr[1];
  for (int i = 2; i <= n; i++) {
    left1[i] = left1[i - 1] | arr[i];
  }
  right1[n] = arr[n];
  for (int i = n - 1; i >= 1; i--) {
    right1[i] = right1[i + 1] | arr[i];
  }
  long long maxans = -1;
  for (int i = 1; i <= n; i++) {
    if (i == 1) {
      maxans = max(maxans, (arr[i] * mul) | right1[i + 1]);
    } else if (i == n) {
      maxans = max(maxans, left1[i - 1] | (arr[i] * mul));
    } else {
      maxans = max(maxans, left1[i - 1] | (arr[i] * mul) | right1[i + 1]);
    }
  }
  printf("%lld ", maxans);
}
