from itertools import chain
matrix = [[1,2,3],[4,-5,6],[7,8,9]]
try:
print(next(i for i in chain.from_iterable(matrix) if i < 0))
except StopIteration:
pass
ZnJvbSBpdGVydG9vbHMgaW1wb3J0IGNoYWluCm1hdHJpeCA9IFtbMSwyLDNdLFs0LC01LDZdLFs3LDgsOV1dCnRyeToKCXByaW50KG5leHQoaSBmb3IgaSBpbiBjaGFpbi5mcm9tX2l0ZXJhYmxlKG1hdHJpeCkgaWYgaSA8IDApKQpleGNlcHQgU3RvcEl0ZXJhdGlvbjoKCXBhc3M=