#include <bits/stdc++.h>
using namespace std;
const int maxn = 200010;
int n, k, x;
long long data[maxn];
long long front[maxn], back[maxn];
long long ans;
int main() {
  cin >> n >> k >> x;
  for (int i = 2, j = x; i <= k; i++) x *= j;
  for (int i = 1; i <= n; i++) cin >> data[i];
  for (int i = 1; i <= n; i++) front[i] = front[i - 1] | data[i];
  for (int i = n; i >= 1; i--) back[i] = back[i + 1] | data[i];
  for (int i = 1; i <= n; i++)
    ans = max(ans, front[i - 1] | back[i + 1] | (data[i] * x));
  printf("%I64d\n", ans);
  return 0;
}
