#include <bits/stdc++.h>
using namespace std;
long long modexpo(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % 1000000007;
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return res;
}
long long expo(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a);
    a = (a * a);
    b >>= 1;
  }
  return res;
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i += 6) {
    if ((n % i == 0) || (n % (i + 2) == 0)) return false;
  }
  return true;
}
long double dist(long long x1, long long y1, long long x2, long long y2) {
  return (long double)sqrt(
      (long double)((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)));
}
long long squaredist(long long x1, long long y1, long long x2, long long y2) {
  return ((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
long long nCr(long long n, long long r) {
  if (r == 0) return 1;
  return (n * nCr(n - 1, r - 1)) / r;
}
int main() {
  long long n, k, x;
  cin >> n >> k >> x;
  vector<long long> arr(n, 0);
  vector<long long> pref_or(n, 0), suff_or(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (i != 0) pref_or[i] = pref_or[i - 1] | arr[i - 1];
  }
  for (int i = n - 2; i >= 0; i--) {
    suff_or[i] = suff_or[i + 1] | arr[i + 1];
  }
  x = expo(x, k);
  while (k) {
    int index = 0;
    long long ma = 0;
    for (int i = 0; i < n; i++) {
      if (i == 0) {
        if ((suff_or[i] | (arr[i] * x)) > ma) {
          index = i;
        }
        ma = max(ma, (suff_or[i] | (arr[i] * x)));
      } else if (i == n - 1) {
        if ((pref_or[i] | (arr[i] * x)) > ma) {
          index = i;
        }
        ma = max(ma, (pref_or[i] | (arr[i] * x)));
      } else {
        if ((pref_or[i] | suff_or[i] | (arr[i] * x)) > ma) {
          index = i;
        }
        ma = max(ma, (pref_or[i] | suff_or[i] | (arr[i] * x)));
      }
    }
    arr[index] = arr[index] * x;
    k = 0;
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) ans = ans | arr[i];
  cout << ans << endl;
  return 0;
}
