#!/usr/bin/python3
from sys import stdin

def main ():
    read = stdin.readline
    t = int (read ())
    for t_ in range (t):
        n, k, p = map (int, read ().split ())
        kl = list (map (int, read ().split ())) + [n + 1]
        if p > n - k:
            print (-1)
            continue
        for r in kl:
            if r > p:
                print (p)
                break
            p += 1

if __name__ == "__main__": main ()

ce46338ff32b5037f66a6cfb4a03fa0068558436
<mask token>

<mask token>


def main():
    read = stdin.readline
    t = int(read())
    for t_ in range(t):
        n, k, p = map(int, read().split())
        kl = list(map(int, read().split())) + [n + 1]
        if p > n - k:
            print(-1)
            continue
        for r in kl:
            if r > p:
                print(p)
                break
            p += 1


<mask token>

<mask token>


def main():
    read = stdin.readline
    t = int(read())
    for t_ in range(t):
        n, k, p = map(int, read().split())
        kl = list(map(int, read().split())) + [n + 1]
        if p > n - k:
            print(-1)
            continue
        for r in kl:
            if r > p:
                print(p)
                break
            p += 1


if __name__ == '__main__':
    main()

from sys import stdin


def main():
    read = stdin.readline
    t = int(read())
    for t_ in range(t):
        n, k, p = map(int, read().split())
        kl = list(map(int, read().split())) + [n + 1]
        if p > n - k:
            print(-1)
            continue
        for r in kl:
            if r > p:
                print(p)
                break
            p += 1


if __name__ == '__main__':
    main()

#!/usr/bin/python3
from sys import stdin

def main ():
    read = stdin.readline
    t = int (read ())
    for t_ in range (t):
        n, k, p = map (int, read ().split ())
        kl = list (map (int, read ().split ())) + [n + 1]
        if p > n - k:
            print (-1)
            continue
        for r in kl:
            if r > p:
                print (p)
                break
            p += 1

if __name__ == "__main__": main ()
