#include <bits/stdc++.h>
using namespace std;
const int M = 2e5 + 2;
long long suffix[M], a[M], prefix[M];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ;
  int n, k, x;
  cin >> n >> k >> x;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  long long mul = 1;
  while (k--) {
    mul *= x;
  }
  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;
}
