x = input ()
y = input ()
int(x)
int(y)
if x>y:
print(y)
else:
print (x)
x = int(input())
y = int(input())
print(x) if x > y else print(y)
x = input ()
y = input ()
int(x)
int(y)
if x>y:
print(y)
else:
print (x)
x = int(input())
y = int(input())
print(x) if x > y else print(y)