#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  int n, k, x;
  cin >> n >> k >> x;
  long long a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long mul = 1;
  for (int i = 0; i < k; i++) {
    mul *= x;
  }
  long long pre[n + 1];
  pre[0] = 0;
  long long sur[n + 1];
  sur[n] = 0;
  for (int i = 1; i < n; i++) {
    pre[i] = pre[i - 1] | a[i - 1];
    sur[n - i] = sur[n - i + 1] | a[n - i];
  }
  long long max = 0;
  for (int i = 0; i < n; i++) {
    long long cur = pre[i] | (mul * a[i]) | sur[i + 1];
    max = cur > max ? cur : max;
  }
  cout << max << endl;
  return 0;
}
