#include <bits/stdc++.h>
using namespace std;
const long long int maxN = 3e5 + 10;
long long int r[maxN], l[maxN], a[maxN], n, k, x;
int main() {
  cin >> n >> k >> x;
  long long int p = pow(x, k), mx = 0;
  for (long long int i = 1; i <= n; i++) {
    cin >> a[i];
    r[i] = r[i - 1] | a[i];
  }
  for (long long int i = n; i > 0; i--) {
    l[i] = l[i + 1] | a[i];
    long long int h = l[i + 1] | r[i - 1] | (p * a[i]);
    mx = max(mx, h);
  }
  cout << mx << endl;
}
