#include <bits/stdc++.h>
using namespace std;
long long a[200050], pref[200050], suff[200050];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m, l, p = 1, k, mx = 0;
  cin >> n >> m >> l;
  for (int i = 1; i <= m; i++) {
    p *= l;
  }
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    pref[i] = (pref[i - 1] | a[i]);
  }
  for (int i = n; i >= 1; i--) {
    suff[i] = (suff[i + 1] | a[i]);
  }
  for (int i = 1; i <= n; i++) {
    k = (pref[i - 1] | suff[i + 1]) | (a[i] * p);
    if (k > mx) mx = k;
  }
  cout << mx << "\n";
  return 0;
}
