#include <bits/stdc++.h>
using namespace std;
int a[200010], bit[35];
int main() {
  memset(a, 0, sizeof(a));
  int n, k, x;
  scanf("%d%d%d", &n, &k, &x);
  for (int i = 0, k, cur; i < n; i++) {
    scanf("%d", &a[i]);
    k = a[i];
    cur = 0;
    while (k) {
      bit[cur++] += (k & 1);
      k >>= 1;
    }
  }
  long long ans = 0, st = 1;
  for (int i = 0; i < k; i++) st *= x;
  for (int i = 0, k = a[i], cur; i < n; i++) {
    long long tmp = 0;
    k = a[i];
    cur = 0;
    while (k) {
      bit[cur++] -= (k & 1);
      k >>= 1;
    }
    for (int j = 0; j <= 30; j++)
      if (bit[j]) tmp |= (1 << j);
    tmp |= a[i] * st;
    if (ans < tmp) ans = tmp;
    k = a[i];
    cur = 0;
    while (k) {
      bit[cur++] += (k & 1);
      k >>= 1;
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
