Thank you for your answer, but this wasn't the problem.
I dont want to find just the minima and maxima of a chromosome.
I want to find the overlapping regions and find the minima and maxima of that.
So when there are lines in the 4 files like this:
chr1 100 500
chr1 25 50
chr1 10 50
chr1 60 80
chr1 12 40
chr1 41 45
chr1 20 45
chr1 48 80
The line of the first file does not overlap with the other 3 files, so i dont want to find the minima and maxima. I want to find only the minima and maxima of the regions in which the lines of all four files overlap each other. So the minima and maxima of the other regions in the files. Minima = 10 maxima = 80