#include <bits/stdc++.h>
using namespace std;
const int MAX = 200005;
long long arr[MAX];
long long prefix[MAX];
long long suffix[MAX];
int main() {
  long long n, k, x;
  cin >> n >> k >> x;
  long long val = 1, ans = 0;
  while (k--) val *= x;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    ans = ans | arr[i];
  }
  if (x == 1) {
    cout << ans << endl;
    return 0;
  }
  for (int i = 1; i < n; i++) prefix[i] = prefix[i - 1] | arr[i - 1];
  for (int i = n - 2; i >= 0; i--) suffix[i] = suffix[i + 1] | arr[i + 1];
  ans = 0;
  for (int i = 0; i < n; i++) {
    ans = max(prefix[i] | (arr[i] * val) | suffix[i], ans);
  }
  cout << ans << endl;
  return 0;
}
