#include <bits/stdc++.h>
using namespace std;
long long n, k, x;
long long s[200002], a[200002], bs[200002];
long long Max = -1;
long long p = 1;
int main() {
  cin >> n >> k >> x;
  for (int i = 1; i <= k; i++) {
    p *= x;
  }
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    s[i] = s[i - 1] | a[i];
  }
  for (int i = n; i >= 1; i--) {
    bs[i] = bs[i + 1] | a[i];
  }
  for (int i = 1; i <= n; i++) {
    Max = max(Max, ((s[i - 1]) | (a[i] * p)) | (bs[i + 1]));
  }
  cout << Max;
}
