#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
#pragma GCC optimize("unroll-loops")
using namespace std;
mt19937 gen(chrono::system_clock::now().time_since_epoch().count());
const int N = 1e5 + 10;
const long long MOD = 1e9 + 7;
const int rx[4] = {-1, 0, 1, 0};
const int ry[4] = {0, 1, 0, -1};
const long double eps = 1e-7;
const double pi = acos(-1.0);
const long long INF = 1e9;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, k, x;
  cin >> n >> k >> x;
  vector<int> kol(64, 0);
  long long a[n];
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ans |= a[i];
    for (int j = 0; j < 64; j++) {
      if ((a[i] & (1 << j))) kol[j]++;
    }
  }
  long long r = 1;
  while (k) {
    r *= x;
    k--;
  }
  long long mx = ans;
  for (int i = 0; i < n; i++) {
    long long e = ans;
    for (int j = 0; j < 64; j++) {
      if ((a[i] & (1ll << j))) {
        kol[j]--;
        if (kol[j] == 0) e -= (1ll << j);
      }
    }
    long long t = a[i] * r;
    mx = max(mx, (e | t));
    for (int j = 0; j < 64; j++) {
      if ((a[i] & (1ll << j))) {
        kol[j]++;
      }
    }
  }
  cout << mx << endl;
  return 0;
}
