You are given *n* numbers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub>. You can perform at most *k* operations. For each operation you can multiply one of the numbers by *x*. We want to make <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/1faa5be276f646dfb07d2a01bf67449ad72c0ef7.png" style="max-width: 100.0%;max-height: 100.0%;"/> as large as possible, where <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/ddbf6923ea3f08cb83b08ed026f40a80751dff3f.png" style="max-width: 100.0%;max-height: 100.0%;"/> denotes the bitwise OR. 

Find the maximum possible value of <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/1faa5be276f646dfb07d2a01bf67449ad72c0ef7.png" style="max-width: 100.0%;max-height: 100.0%;"/> after performing at most *k* operations optimally.
The first line contains three integers *n*, *k* and *x* (1 ≤ *n* ≤ 200 000, 1 ≤ *k* ≤ 10, 2 ≤ *x* ≤ 8).

The second line contains *n* integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (0 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>).
import math
import sys
from random import randint as rn
import random
import functools
from heapq import heappop, heappush


def solve():
    n, k, x = map(int, sys.stdin.readline().split())
    a = list(map(int, sys.stdin.readline().split()))

    mx_bits = 0
    all_or = [0 for i in range(64)]

    for i in range(n):
        for b in range(64):
            if a[i] & (1 << b) != 0:
                all_or[b] += 1
                mx_bits = max(mx_bits, b)



    best = [0 for i in range(64)]

    for i in a:
        if i & (1<<mx_bits) == 0:
            continue

        cur = all_or.copy()
        for b in range(64):
            if i & (1 << b) != 0:
                cur[b] -= 1

        cc = i * pow(x, k)
        for b in range(64):
            if cc & (1 << b) != 0:
                cur[b] += 1

        best = max(best, cur)

    res = 0
    for i in range(len(best)):
        if best[i] != 0:
            res += (1 << i)

    print(res)
    return


if __name__ == '__main__':

    multitest = 0

    if multitest:
        t = int(sys.stdin.readline())
        for _ in range(t):
            solve()
    else:
        solve()
    # gen()
