#include <bits/stdc++.h>
#pragma comment(linker, "/stack:102400000,102400000")
using namespace std;
const int N = 200005;
const int M = 10005;
const int INF = 0x3f3f3f3f;
const int MOD = 1000000007;
const double Pi = acos(-1.0);
int lowbit(int x) { return x & (-x); }
template <class T>
inline T f_min(T a, T b) {
  return a < b ? a : b;
}
template <class T>
inline T f_max(T a, T b) {
  return a > b ? a : b;
}
template <class T>
inline T f_abs(T a) {
  return a > 0 ? a : -a;
}
template <class T>
inline T f_gcd(T a, T b) {
  return b == 0 ? a : f_gcd(b, a % b);
}
template <class T>
inline T f_Lcm(T a, T b) {
  return a / f_gcd(a, b) * b;
}
template <class T>
inline void f_swap(T &a, T &b) {
  T t = a;
  a = b;
  b = t;
}
bool is_digit(char a) {
  if (a >= '0' && a <= '9') return true;
  return false;
}
bool is_lowch(char a) {
  if (a >= 'a' && a <= 'z') return true;
  return false;
}
bool is_upch(char a) {
  if (a >= 'A' && a <= 'Z') return true;
  return false;
}
int a[N], num[35];
int main() {
  int n, k, x;
  while (cin >> n >> k >> x) {
    for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
    memset(num, 0, sizeof(num));
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < 31; ++j)
        if ((1 << j) & a[i]) num[j]++;
    }
    int temp = 1;
    for (int i = 0; i < k; ++i) temp *= x;
    int ma = -1;
    for (int i = 0; i < 31; ++i)
      if (num[i]) ma = i;
    if (ma == -1) {
      puts("0");
      continue;
    }
    long long ans = 0;
    for (int i = 0; i < n; ++i) {
      long long res = 1LL * temp * a[i];
      for (int j = 0; j < 31; ++j)
        if (num[j] > 1 || (num[j] == 1 && !((1 << j) & a[i]))) {
          res |= (1 << j);
        }
      ans = f_max(ans, res);
    }
    cout << ans << endl;
  }
  return 0;
}
