#include <bits/stdc++.h>   using namespace std;   unsigned long long get_idx(int p) {     int idx = 1;     while (idx < p) idx *= 2;     return idx;   }   void update(vector<unsigned long long> &tree, unsigned long long idx,               unsigned long long val) {     tree[idx] = val;     idx /= 2;     while (idx) {       tree[idx] = tree[idx * 2] | tree[idx * 2 + 1];       idx /= 2;     }   }   int main() {     unsigned long long n, k, x, a = 1;     unsigned long long ans = 0;     cin >> n >> k >> x;     vector<unsigned long long> data(n);     for (int i = 0; i < k; i++) a *= x;     for (int i = 0; i < n; i++) cin >> data[i];     unsigned long long idx = get_idx(n);     vector<unsigned long long> tree(idx * 2);     for (int i = idx; i < idx + n; i++) update(tree, i, data[i - idx]);     for (int i = 0; i < n; i++) {       update(tree, i + idx, data[i] * a);       ans = max(tree[1], ans);       update(tree, i + idx, data[i]);     }     cout << ans << endl;   }   