#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
long long int mod = 1000000007;
double PI = 3.14159265358979323846264338327950288;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
long long int power(long long int x, long long int y) {
  long long int ans = 1;
  while (y > 0) {
    if (y & 1) ans = ans * x;
    x = x * x;
    y = y >> 1;
  }
  return ans;
}
long long int arr[1000010] = {0}, lef[200010] = {0}, righ[200010] = {0};
int main() {
  long long int m, n, q, test, k, x, ans = 0, maxi = 0;
  scanf("%lld%lld%lld", &n, &k, &x);
  x = power(x, k);
  for (long long int i = (1); i < (n + 1); i++) {
    scanf("%lld", &arr[i]);
    lef[i] = lef[i - 1] | arr[i];
  }
  for (long long int i = (n); i >= (1); i--) righ[i] = righ[i + 1] | arr[i];
  for (long long int i = (1); i < (n + 1); i++)
    ans = max(ans, (lef[i - 1] | arr[i] * x | righ[i + 1]));
  printf("%lld\n", ans);
  return 0;
}
