Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys
import itertools


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    # Failed to predict input format
    N, M, X = [int(x) for x in input().split()]
    C = []
    A = []
    for i in range(N):
        tmp = [int(x) for x in input().split()]
        C.append(tmp[0])
        A.append(tmp[1:])
    CA = [[C[i], v] for i, v in enumerate(A)]
    l = list(itertools.permutations(CA, N))
    anss = [100100100] * len(l)
    for i, v in enumerate(l):
        arr = [0] * M
        s = 0
        for j in v:
            arr = python_list_add(arr, j[1])
            s += j[0]
            if all([x >= X for x in arr]):
                anss[i] = s
                break
    ans = min(anss)
    if ans == 100100100:
        print(-1)
        return
    print(ans)
    return


def python_list_add(in1, in2):
    return [a + b for a, b in zip(in1, in2)]


if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys
import itertools


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N, M, X = [int(x) for x in input().split()]
    C = []
    A = []
    for i in range(N):
        tmp = [int(x) for x in input().split()]
        C.append(tmp[0])
        A.append(tmp[1:])
    CA = [[C[i], v] for i, v in enumerate(A)]

    # TLE
    # l = list(itertools.permutations(CA, N))
    # anss = [100100100] * len(l)
    # for i, v in enumerate(l):
    #     arr = [0] * M
    #     s = 0
    #     for j in v:
    #         arr = python_list_add(arr, j[1])
    #         s += j[0]
    #         if all([x >= X for x in arr]):
    #             anss[i] = s
    #             break
    # ans = min(anss)
    # if ans == 100100100:
    #     print(-1)
    #     return
    # print(ans)

    # bit全探索
    anss = []
    for i in range(2 ** N):
        s = 0
        arr = [0] * M
        for j in range(N):
            if i >> j & 1:
                s += CA[j][0]
                arr = python_list_add(arr, CA[j][1])
            if all([x >= X for x in arr]):
                anss.append(s)
    print(min(anss) if anss else -1)

    return


def python_list_add(in1, in2):
    return [a + b for a, b in zip(in1, in2)]


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys
import itertools


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    # Failed to predict input format
    N, M, X = [int(x) for x in input().split()]
    C = []
    A = []
    for i in range(N):
        tmp = [int(x) for x in input().split()]
        C.append(tmp[0])
        A.append(tmp[1:])
    CA = [[C[i], v] for i, v in enumerate(A)]
    l = list(itertools.permutations(CA, N))
    anss = [100100100] * len(l)
    for i, v in enumerate(l):
        arr = [0] * M
        s = 0
        for j in v:
            arr = python_list_add(arr, j[1])
            s += j[0]
            if all([x >= X for x in arr]):
                anss[i] = s
                break
    ans = min(anss)
    if ans == 100100100:
        print(-1)
        return
    print(ans)
    return


def python_list_add(in1, in2):
    return [a + b for a, b in zip(in1, in2)]





    
    return


if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys
import itertools


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N, M, X = [int(x) for x in input().split()]
    C = []
    A = []
    for i in range(N):
        tmp = [int(x) for x in input().split()]
        C.append(tmp[0])
        A.append(tmp[1:])
    CA = [[C[i], v] for i, v in enumerate(A)]

    # TLE
    # l = list(itertools.permutations(CA, N))
    # anss = [100100100] * len(l)
    # for i, v in enumerate(l):
    #     arr = [0] * M
    #     s = 0
    #     for j in v:
    #         arr = python_list_add(arr, j[1])
    #         s += j[0]
    #         if all([x >= X for x in arr]):
    #             anss[i] = s
    #             break
    # ans = min(anss)
    # if ans == 100100100:
    #     print(-1)
    #     return
    # print(ans)

    # bit全探索
    anss = []
    for i in range(2 ** N):
        s = 0
        arr = [0] * M
        for j in range(N):
            if i >> j & 1:
                s += CA[j][0]
                arr = python_list_add(arr, CA[j][1])
            if all([x >= X for x in arr]):
                anss.append(s)
    print(min(anss) if anss else -1)

    return


def python_list_add(in1, in2):
    return [a + b for a, b in zip(in1, in2)]


if __name__ == '__main__':
    main()