求助python大佬,那个牛牛找工作,这样写为什么一直出错
```
line_1 = input().split()
n,m = int(line_1[0]),int(line_1[1])
work_re = []
for i in range(n):
line = input().split()
work_re.append([int(x) for x in line])
m_cap = [int(x) for x in input().split()]
work_re.sort()
res = []
for i in m_cap:
tag = None
for j in work_re:
if j[0] <= i:
tag = j
res.append(tag[1])
for p in res:
print(p)
```
#笔试题目##实习#