The circle line of the Berland subway hasnstations. We know the distances between all pairs of neighboring stations:
·d1is the distance between the1-st and the2-nd station;
·d2is the distance between the2-nd and the3-rd station;
...
·dn-1is the distance between then-1-th and then-th station;
·dnis the distance between then-th and the1-st station.
The trains go along the circle line in both directions. Find the shortest distance between stations with numberssandt.