#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  long long int x;
  cin >> n >> k >> x;
  vector<long long int> mnums(n + 2, 0);
  vector<long long int> prefor(n + 2, 0);
  vector<long long int> sufor(n + 2, 0);
  for (int i = 1; i <= n; ++i) cin >> mnums[i];
  long long int mul = 1;
  for (int i = 1; i <= k; ++i) mul *= x;
  for (int i = 1; i <= n; ++i) {
    prefor[i] = mnums[i] | prefor[i - 1];
  }
  for (int i = n; i >= 1; --i) sufor[i] = mnums[i] | sufor[i + 1];
  long long int ans = 0;
  for (int i = 1; i <= n; ++i) {
    ans = max(ans, prefor[i - 1] | mnums[i] * mul | sufor[i + 1]);
  }
  cout << ans << endl;
  return 0;
}
