#include <bits/stdc++.h>
using namespace std;
long long A[200005];
long long B[200005][70];
long long X[70];
long long Y[70];
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(0);
  int n, k, x;
  cin >> n >> k >> x;
  for (int(i) = 0; (i) < (69); ++(i)) X[i] = -2;
  for (int(i) = 0; (i) < (n); ++(i)) {
    cin >> A[i];
    int z = A[i], dig = 68;
    while (z != 0) {
      B[i][dig--] = z % 2;
      z /= 2;
    }
  }
  int start = 100;
  for (int(i) = 0; (i) < (n); ++(i)) {
    for (int(j) = 0; (j) < (69); ++(j)) {
      if (B[i][j]) {
        if (j < start) start = j;
      }
    }
  }
  for (int(i) = (start); (i) <= (68); ++(i)) {
    for (int(j) = 0; (j) < (n); ++(j)) {
      if (B[j][i]) {
        if (X[i] >= 0) {
          X[i] = -1;
        } else if (X[i] != -1) {
          X[i] = j;
        }
      }
    }
  }
  long long mul = 1;
  int idx = 68, cur;
  long long ans = 0;
  for (int(i) = 0; (i) < (k); ++(i)) mul *= x;
  for (int(i) = 0; (i) < (n); ++(i)) {
    long long p = A[i] * mul;
    idx = 68;
    while (p != 0) {
      cur = p % 2;
      if (X[idx] == -1) {
        Y[idx] = 1;
      } else if (X[idx] != i && X[idx] != -2) {
        Y[idx] = 1;
      } else if (cur == 1) {
        Y[idx] = 1;
      } else {
        Y[idx] = 0;
      }
      idx--;
      p /= 2;
    }
    long long ans2 = 0;
    long long xx = 0;
    for (int(i) = (68); (i) >= (0); --(i)) {
      ans2 += (1LL << xx) * Y[i];
      xx++;
    }
    for (int(i) = 0; (i) < (69); ++(i)) Y[i] = 0;
    ans = max(ans, ans2);
  }
  cout << ans << endl;
  return 0;
}
