#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 2;
long long a[MAXN], prefix[MAXN], suffix[MAXN];
int main() {
  int n, k, x;
  cin >> n >> k >> x;
  long long mul = 1;
  while (k--) mul *= x;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) prefix[i] = prefix[i - 1] | a[i];
  for (int i = n; i > 0; i--) suffix[i] = suffix[i + 1] | a[i];
  long long ans = 0;
  for (int i = 1; i <= n; i++)
    ans = max(ans, prefix[i - 1] | (a[i] * mul) | suffix[i + 1]);
  cout << ans << endl;
  return 0;
}
