package main import "fmt" func shift(a int) int { return (1<<15)*(a%2) + (a / 2) } func main() { var n int fmt.Scanln(&n) a := make([]int, n) for i := 0; i < n; i++ { fmt.Scan(&a[i]) } if n >= 16 { fmt.Println((1 << 16) - 1) return } dp := make([]bool, 1<<16) x := a[0] for j := 0; j < 16; j++ { dp[x] = true x = shift(x) } for i := 1; i < n; i++ { x = a[i] temp := make([]bool, 1<<16) for j := 0; j < 16; j++ { for k := 0; k < (1 << 16); k++ { if dp[k] { temp[k^x] = true } } x = shift(x) } dp = temp } max := 0 for k := 0; k < (1 << 16); k++ { if dp[k] && (k > max) { max = k } } fmt.Println(max) }