# We can get the data from standard input.
# The number of pairs can be removed; the data is unnecessary.
import sys
input_data = list(sys.stdin)[1:]
output     = []
# We need to iterate through the data sets.
for dataset in input_data:
    # Separate the elements. Create a temporary list for this purpose.
    l = dataset.split(" ")
    # Cast each element (currently a string) to an integer.
    # This is necessary to use the min() function.
    l = [int(e) for e in l]
    # Get the minimum value and append it to the output list.
    output.append(min(l))
print(output)