#include <bits/stdc++.h>
using namespace std;
int n, k;
long long x;
long long ans;
long long a[200100];
long long sum1[200100], sum2[200100];
int main() {
  scanf("%d%d%I64d", &n, &k, &x);
  for (int i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  for (int i = 1; i <= n; i++) sum1[i] = sum1[i - 1] | a[i];
  for (int i = n; i >= 1; i--) sum2[i] = sum2[i + 1] | a[i];
  long long abcd = 1;
  for (int i = 1; i <= k; i++) abcd *= x;
  for (int i = 1; i <= n; i++)
    ans = max((sum1[i - 1] | a[i] * abcd) | sum2[i + 1], ans);
  printf("%I64d\n", ans);
}
