#include <bits/stdc++.h>
using namespace std;
long long n, k, x, a[200020], b[200020], ans, i, j, v;
long long s[200020], t[200020];
int main() {
  scanf("%I64d%I64d%I64d", &n, &k, &x);
  for (i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  for (i = 1; i <= n; i++) {
    b[i] = a[i];
    for (j = 1; j <= k; j++) b[i] *= x;
  }
  for (i = 1; i <= n; i++)
    for (j = 0; j <= 62; j++)
      if ((1LL << j) & a[i]) s[j]++;
  for (i = 1; i <= n; i++) {
    v = 0;
    for (j = 0; j <= 62; j++) {
      if ((1LL << j) & a[i])
        t[j] = s[j] - 1;
      else
        t[j] = s[j];
      if (t[j]) v |= (1LL << j);
    }
    ans = max(ans, v | b[i]);
  }
  printf("%I64d\n", ans);
  return 0;
}
