just like this. append every element into a list and then sort it.

```
class Solution(object):
def kthSmallest(self, matrix, k):
"""
:type matrix: List[List[int]]
:type k: int
:rtype: int
"""
ans=[]
for i in matrix:
ans.extend(i)
ans=sorted(ans)
return ans[k-1]
```