#include <bits/stdc++.h>
using namespace std;
const int MX = 200005;
long long A[MX], B[MX], D[MX];
int main() {
  int N, K, X;
  scanf("%d%d%d", &N, &K, &X);
  for (int i = 1; i <= N; i++) scanf("%lld", D + i);
  for (int i = 1; i <= N; i++) A[i] = A[i - 1] | D[i];
  for (int i = N; i >= 1; i--) B[i] = B[i + 1] | D[i];
  long long ans = 0;
  for (int i = 1; i <= N; i++) {
    long long su = D[i];
    for (int j = 1; j <= K; j++) {
      su *= X;
    }
    ans = max(ans, su | A[i - 1] | B[i + 1]);
  }
  printf("%lld", ans);
  return 0;
}
