#lang racket

(define (add-list u v)
  (if (or (null? u) (null? v))
      null
      (cons (+ (car u) (car v))
            (add-list (cdr u) (cdr v)))))


(define (sum-choose bit items init)
  (let iter ([i 0] [v items] [total init])
    (if (null? v)
        total
        (iter (+ i 1)
              (cdr v)
              (if (zero? (bitwise-and bit (arithmetic-shift 1 i)))
                  total
                  (add-list total (car v)))))))


(define (solve N M X books ans)
  (define end (arithmetic-shift 1 N))
  (define initial (make-list (+ M 1) 0))
  (define (good x) (>= x X))
  (let iter ([bit 0])
    (if (= bit end)
        (if (= ans +inf.0) -1 (inexact->exact ans))
        (let ([total (sum-choose bit books initial)])
          (set! ans (if (andmap good (cdr total))
                        (min ans (car total))
                        ans))
          (iter (+ bit 1))))))

(define (readline n)
  (if (zero? n)
      null
      (cons (read) (readline (- n 1)))))

(define (readlines n m)
  (if (zero? n)
      null
      (cons (readline m) (readlines (- n 1) m))))

(let* ([N (read)]
       [M (read)]
       [X (read)]
       [books (readlines N (+ M 1))])
  (display (solve N M X books +inf.0)))