#include using namespace std; int main() { int n; cin >> n; int x[n], y[n], ans[n+2]; int pos = INT_MAX; for(int i=0;i> x[i]; for(int i=0;i> y[i]; pos = min(pos, x[i] + y[i]); } ans[0] = 0; ans[n+1] = pos; for(int i=1;i<=n;i++) { if(x[i] >= pos) ans[i] = pos; else ans[i] = x[i]; } cout << pos << endl; for(int i=0;i