ais = map(int, raw_input().split(' '))
s = +float('inf')
for i in range(len(ais)): s = min(ais[i] + ais[(i+1) % len(ais)], s)
print s ais = map(int, raw_input().split(' ')) ais map(int, raw_input().split(' ')) map int raw_input().split(' ') ().split () raw_input split ' ' s = +float('inf') s +float('inf') float('inf') float 'inf' for i in range(len(ais)): s = min(ais[i] + ais[(i+1) % len(ais)], s) i range(len(ais)) range len(ais) len ais print ais = map(int, raw_input().split(' ')) map(int, raw_input().split(' ')) ais s = +float('inf') +float('inf') s
ais = map(int, raw_input().split(' '))
s = +float('inf')
for i in range(len(ais)): s = min(ais[i] + ais[(i+1) % len(ais)], s)
print s
