#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  long long x, m = 1;
  cin >> n >> k >> x;
  for (int i = 0; i < k; i++) m = m * x;
  long long arr[200005];
  long long tot = 0, solid = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    solid = solid | (tot & arr[i]);
    tot = tot | arr[i];
  }
  long long ans = 0, can;
  for (int i = 0; i < n; i++) {
    can = ((tot - arr[i]) | solid) | (arr[i] * m);
    ans = max(ans, can);
  }
  cout << ans;
}
