```
def kthSmallest(self, matrix, k):
heap = [(matrix[0][i], 1, i) for i in range(len(matrix))]
for _ in range(k - 1):
_, i, j = heapq.heappop(heap)
if i < len(matrix):
heapq.heappush(heap, (matrix[i][j], i + 1, j))
return heap[0][0]
```