Option Explicit On

Module Module1

    Sub Main()

        Dim tmp As String() = Split(Console.ReadLine(), " ")

        Dim N As Integer = CInt(tmp(0))
        Dim M As Integer = CInt(tmp(1))
        Dim X As Integer = CInt(tmp(2))

        Dim iT(N - 1, M) As Integer
        Dim wk(2 ^ N, M) As Integer
        For i As Integer = 0 To N - 1
            Dim tmp2 As String() = Split(Console.ReadLine(), " ")
            For j As Integer = 0 To M
                iT(i, j) = CInt(tmp2(j))
                For k As Integer = 1 To 2 ^ N
                    If 2 ^ (i + 1) \ 2 <= k Mod 2 ^ (i + 1) Then
                        wk(k, j) += iT(i, j)
                    End If
                Next
            Next
        Next

        Console.WriteLine(-1)

    End Sub
End Module
