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