#include <bits/stdc++.h>
using namespace std;
inline int MAX(int a, int b) { return (a < b) ? b : a; }
inline int MIN(int a, int b) { return (a > b) ? b : a; }
inline int ABS(int a) { return (a > 0) ? a : -a; }
int n, k, x;
long long int a[200100];
pair<long long int, long long int> v[200100];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k >> x;
  for (int i = 0; i < n; ++i) cin >> a[i];
  long long int p = 1;
  for (int i = 0; i < k; ++i) p *= x;
  long long int sum = 0, value = 0;
  for (long long int i = 0, cur = 0; i < n; ++i) {
    v[i].first = cur;
    cur |= a[i];
  }
  for (long long int i = n - 1, cur = 0; i >= 0; --i) {
    v[i].second = cur;
    cur |= a[i];
  }
  for (int i = 0; i < n; ++i) {
    long long int sumaux = v[i].first | (a[i] * p) | v[i].second;
    if (sumaux > sum) {
      sum = sumaux;
    }
  }
  cout << sum << endl;
  return 0;
}
