#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int inf = 0x3f3f3f3f;
const double eps = 1e-15;
const long long INF = (1LL << 60);
long long a[200010];
long long b[200010];
int Arr[200010];
int main() {
  int n, k, x;
  scanf("%d%d%d", &n, &k, &x);
  a[0] = 0;
  long long now = 1;
  for (int i = 1; i <= k; ++i) {
    now *= x;
  }
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &Arr[i]);
    a[i] = a[i - 1] | Arr[i];
  }
  b[n + 1] = 0;
  for (int i = n; i >= 1; --i) {
    b[i] = b[i + 1] | Arr[i];
  }
  long long ans = 0;
  for (int i = 1; i <= n; ++i) {
    ans = max(ans, a[i - 1] | b[i + 1] | (now * Arr[i]));
  }
  cout << ans << endl;
  return 0;
}
