#include <bits/stdc++.h>
using namespace std;
long long a[200005], dp1[200005], dp2[200005];
int main() {
  long long n, k, x;
  int xx;
  cin >> n >> k >> x;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &xx);
    a[i] = xx;
  }
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    if (i != 1) {
      dp1[i] = dp1[i - 1] | a[i - 1];
    }
  }
  for (int i = n; i >= 1; i--) {
    dp2[i] = dp2[i + 1] | a[i + 1];
  }
  long long mx = 0;
  long long pw = 1;
  for (int i = 1; i <= k; i++) {
    pw *= x;
  }
  for (int i = n; i >= 1; i--) {
    mx = max(mx, ((pw * a[i]) | dp1[i] | dp2[i]));
  }
  cout << mx;
}
