#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  char ch = getchar();
  long long p = 1, data = 0;
  while (ch < '0' || ch > '9') {
    if (ch == '-') p = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    data = data * 10 + (ch ^ 48);
    ch = getchar();
  }
  return p * data;
}
inline long long qpow(long long a, long long b) {
  long long r = 1;
  while (b) {
    if (b & 1) r = a * r;
    a = a * a;
    b >>= 1;
  }
  return r;
}
inline long long gcd(long long a, long long b) {
  while (b ^= a ^= b ^= a %= b)
    ;
  return a;
}
inline long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
void exgcd(long long a, long long b, long long &x, long long &y) {
  if (!b)
    x = 1, y = 0;
  else {
    exgcd(b, a % b, y, x);
    y -= x * (a / b);
  }
}
const int mod = 1e9 + 7;
const int maxn = 2e5 + 5;
long long a[maxn], pre[maxn], suf[maxn], mx = -0x3f3f3f3f;
int main() {
  int n = read(), k = read(), x = read();
  long long c = qpow(x, k);
  for (int i = 1; i <= n; i++) a[i] = read();
  pre[1] = a[1], suf[n] = a[n];
  for (int i = 2; i <= n; i++) pre[i] = pre[i - 1] | a[i];
  for (int i = n - 1; i >= 1; i--) suf[i] = suf[i + 1] | a[i];
  for (int i = 1; i <= n; i++) {
    long long now = pre[i - 1] | suf[i + 1] | (a[i] * c);
    mx = max(mx, now);
  }
  printf("%lld\n", mx);
  return 0;
}
