#include <bits/stdc++.h>
using namespace std;
int N, k;
int pot;
long long a[200005], x;
int bitcnt[34];
int main() {
  int aux;
  scanf("%d%d", &N, &k);
  scanf("%d", &aux);
  x = aux;
  for (int i = 0; i < N; i++) {
    scanf("%I64d", &a[i]);
  }
  for (int i = 1; i < k; i++) x *= aux;
  for (int i = 0; i < N; i++) {
    long long tmp = 1;
    for (int bit = 0; bit < 33; bit++) {
      if (a[i] & tmp) bitcnt[bit]++;
      tmp <<= 1;
    }
  }
  long long ans = 0;
  for (int i = 0; i < N; i++) {
    long long tmp = 1;
    for (int bit = 0; bit < 33; bit++) {
      if (a[i] & tmp) bitcnt[bit]--;
      tmp <<= 1;
    }
    long long tmpans = a[i] * x;
    tmp = 1;
    for (int bit = 0; bit < 33; bit++) {
      if (bitcnt[bit]) tmpans |= tmp;
      tmp <<= 1;
    }
    ans = max(ans, tmpans);
    tmp = 1;
    for (int bit = 0; bit < 33; bit++) {
      if (a[i] & tmp) bitcnt[bit]++;
      tmp <<= 1;
    }
  }
  printf("%I64d\n", ans);
}
