#include <bits/stdc++.h>
using namespace std;
long long a[200005][2], pre[200005], post[200005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0), cout.precision(15);
  int n, k;
  long long x, p = 1, result = 0;
  cin >> n >> k >> x;
  for (int i = 0; i < k; i++) {
    p *= x;
  }
  for (int i = 1; i <= n; i++) {
    cin >> a[i][0];
    a[i][1] = a[i][0] * p;
  }
  for (int i = 1; i <= n; i++) pre[i] = pre[i - 1] | a[i][0];
  for (int i = n; i >= 1; i--) post[i] = post[i + 1] | a[i][0];
  for (int i = 1; i <= n; i++)
    result = max(result, pre[i - 1] | a[i][1] | post[i + 1]);
  cout << result << endl;
  return 0;
}
