#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 200000 + 10, M = 60;
int n, k, x;
ll mul;
ll a[N];
ll prefix[N], suffix[N];
int main() {
  scanf("%d%d%d", &n, &k, &x);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  mul = 1l;
  while (k--) mul *= x;
  prefix[0] = 0ll, suffix[n + 1] == 0ll;
  for (int i = 1; i <= n; i++) {
    prefix[i] = prefix[i - 1] | a[i];
  }
  for (int i = n; i >= 1; i--) {
    suffix[i] = suffix[i + 1] | a[i];
  }
  ll res = 0ll;
  for (int i = 1; i <= n; i++) {
    res = max(res, prefix[i - 1] | (a[i] * mul) | suffix[i + 1]);
  }
  cout << res << endl;
  return 0;
}
