#include <bits/stdc++.h>
using namespace std;
long long a[200005], b[200005], c[200005];
int main() {
  long long n, k, x;
  cin >> n >> k >> x;
  long long t = 1;
  for (int i = 0; i < k; i++) t *= x;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) b[i] = b[i - 1] | a[i];
  for (int i = n; i >= 1; i--) c[i] = c[i + 1] | a[i];
  long long max_sum = 0;
  for (int i = 1; i <= n; i++) {
    if (((a[i] * t) | b[i - 1] | c[i + 1]) > max_sum)
      max_sum = (a[i] * t) | b[i - 1] | c[i + 1];
  }
  cout << max_sum << endl;
  return 0;
}
