#include <bits/stdc++.h>
using namespace std;
inline string get_string() {
  char ch[1000000];
  scanf("%s", ch);
  return ch;
}
long long suffix[1000000], prefix[1000000], theList[250000];
int main() {
  int n, k, x;
  cin >> n >> k >> x;
  long long c = 1, ans = 0;
  for (int i = 1; i <= k; i++) c *= x;
  for (int i = 1; i <= n; i++) cin >> theList[i];
  for (int i = 1; i <= n; i++) prefix[i] = prefix[i - 1] | theList[i];
  for (int i = n; i > 0; i--) suffix[i] = suffix[i + 1] | theList[i];
  for (int i = 1; i <= n; i++)
    ans = max(ans, prefix[i - 1] | (theList[i] * c) | suffix[i + 1]);
  cout << ans << "\n";
}
