q = int(input()) w = int(input()) e = int(input()) r = int(input()) min_number = min(q, w, e, r) print(min_number)
w = int(input())
e = int(input())
r = int(input())
if q < w < e < r:
print(q)
if w < q < e < r:
print(w)
if e < w < q < r:
print(e)
if r < w < e < q:
print(r)