a = float(input("a: "))
b = float(input("b: "))
c = float(input("c: "))
d = float(input("d: "))
ma = max(a,b);
mi = min(a,b);
ma = max(ma,c)
mi = min(mi,c)
ma = max(ma, d)
mi = min(mi,d)
print(ma)
print(mi)
