#include <bits/stdc++.h>
using namespace std;
long long n, k, x, a[1000000];
long long f[1000000], f1[1000000];
long long res;
int main() {
  cin >> n >> k >> x;
  for (int i = 1; i <= n; ++i) scanf("%I64d", &a[i]);
  for (int i = 1; i <= n; ++i) f[i] = f[i - 1] | a[i];
  for (int i = n; i >= 1; --i) f1[i] = f1[i + 1] | a[i];
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= k; ++j) a[i] = a[i] * x;
  for (int i = 1; i <= n; ++i) res = max(f[i - 1] | f1[i + 1] | a[i], res);
  cout << res;
}
