#include <bits/stdc++.h>
using namespace std;
int numSet[40];
vector<long long> nums;
void add(long long num) {
  for (long long i = 0; i < 33; i++) {
    numSet[i] += (num & (1LL << i)) ? 1 : 0;
  }
}
long long rem(long long num) {
  long long res = 0;
  for (long long i = 0; i < 33; i++) {
    if (numSet[i] == 1 && (num & (1LL << i))) {
      continue;
    }
    if (numSet[i] > 0) res |= (1LL << i);
  }
  return res;
}
int main() {
  ios::sync_with_stdio(0);
  long long n, k, x;
  cin >> n >> k >> x;
  nums.resize(n);
  long long acc;
  for (int i = 0; i < n; i++) {
    cin >> nums[i];
    add(nums[i]);
  }
  long long res = nums[0];
  for (int i = 0; i < n; i++) {
    long long without = rem(nums[i]);
    for (int j = 0; j < k; j++) nums[i] *= x;
    res = max(res, without | nums[i]);
  }
  cout << res;
  return 0;
}
