#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
long long a[N];
long long l[N], r[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, x, k;
  cin >> n >> k >> x;
  for (int i = 0; i < n; i++) cin >> a[i];
  long long p = 1;
  while (k--) p *= x;
  l[0] = a[0];
  r[n - 1] = a[n - 1];
  for (int i = 1; i < n; i++) l[i] = a[i] | l[i - 1];
  for (int i = n - 2; i > -1; i--) r[i] = a[i] | r[i + 1];
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    int last = i > 0 ? l[i - 1] : 0;
    int next = i + 1 < n ? r[i + 1] : 0;
    ans = max(ans, last | a[i] * p | next);
  }
  cout << ans << endl;
}
