#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000 + 5;
int a[maxn], num[40];
long long q[40];
int main() {
  q[0] = 1;
  for (int i = 1; i < 40; ++i) {
    q[i] = q[i - 1] << 1;
  }
  int n, k, x;
  while (~scanf("%d%d%d", &n, &k, &x)) {
    memset(num, 0, sizeof(num));
    long long temp = 0, ans = 0;
    for (int i = 0; i < n; ++i) {
      scanf("%d", a + i);
      temp |= a[i];
      for (int j = 0; j < 32; ++j) {
        if (a[i] >> j & 1) {
          ++num[j];
        }
      }
    }
    long long p = 1;
    ans = temp;
    for (int l = 0; l < k; ++l) {
      p *= x;
    }
    for (int i = 0; i < n; ++i) {
      long long s = temp;
      for (int j = 0; j < 32; ++j) {
        if ((a[i] >> j & 1) && num[j] == 1) {
          s ^= q[j];
        }
      }
      ans = max(ans, s | (a[i] * p));
    }
    printf("%I64d\n", ans);
  }
  return 0;
}
