#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
long long a[N], p[N], s[N];
int main() {
  int n, k, x;
  cin >> n >> k >> x;
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  for (int i = 1; i <= n; i++) p[i] = p[i - 1] | a[i];
  for (int i = n; i > 0; i--) s[i] = s[i + 1] | a[i];
  long long f = 1;
  while (k--) f *= x;
  long long maxx = -1;
  for (int i = 1; i <= n; i++)
    maxx = max(maxx, p[i - 1] | (f * a[i]) | s[i + 1]);
  printf("%lld\n", maxx);
  return 0;
}
