#include <bits/stdc++.h>
using namespace std;
long long suf[200010], a[200010];
int n, k, x, v;
long long res;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> k >> x;
  v = 1;
  for (int i = 0; i < k; i++) v *= x;
  for (int i = 0; i < n; i++) cin >> a[i];
  long long now = 0;
  for (int i = n - 1; i >= 0; i--) suf[i] = (now |= a[i]);
  now = 0;
  for (int i = 0; i < n; now |= a[i++]) {
    res = max(res, now | suf[i + 1] | (a[i] * v));
  }
  cout << res << endl;
  return 0;
}
