#include <bits/stdc++.h>
const int inf = 1e+9;
using namespace std;
unsigned long long a[200010];
unsigned long long t[200010];
unsigned long long q[200010];
unsigned long long p[200010];
int main() {
  unsigned long long n, k, x;
  unsigned long long max = 0;
  cin >> n >> k >> x;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    t[i] = a[i];
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= k; j++) {
      t[i] *= x;
    }
  }
  for (int i = 1; i <= n; i++) {
    q[i] |= q[i - 1] | a[i];
  }
  for (int i = n; i >= 1; i--) {
    p[i] |= p[i + 1] | a[i];
  }
  for (int i = 1; i <= n; i++) {
    t[i] |= q[i - 1];
    t[i] |= p[i + 1];
    max = std::max(max, t[i]);
  }
  cout << max << endl;
  return 0;
}
