#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, x;
  int A[200010] = {0}, L[200010] = {0}, R[200010] = {0};
  scanf("%d%d%d", &n, &k, &x);
  for (int i = 1; i <= n; i++) {
    scanf("%d", A + i);
  }
  sort(A + 1, A + 1 + n);
  for (int i = 1; i <= n; i++) {
    L[i] = A[i] | L[i - 1];
  }
  for (int i = n; i >= 1; i--) {
    R[i] = A[i] | R[i + 1];
  }
  long long ret = 0, m = 1;
  for (int i = 1; i <= k; i++) {
    m *= x;
  }
  for (int i = 1; i <= n; i++) {
    long long ans = A[i] * m | L[i - 1] | R[i + 1];
    if (ans > ret) {
      ret = ans;
    }
  }
  printf("%I64d\n", ret);
}
