#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
using namespace std;
using ll = long long;
using ld = long double;

int main() {
	int N;
	ll ans=10000000;
	cin >> N;
	vector<ll>A(N), B(N);
	rep(i, N) {
		cin >> A[i] >> B[i];
		ans = min(ans, A[i] + B[i]);
	}
	sort(A.begin(), A.end());sort(B.begin(), B.end());
	if (A[0] + B[0] != ans) {
		ans = min(ans, max(A[0], B[0]));
	}
	else {
		ans = min(ans, max(A[0], B[1]));
		ans = min(ans, max(A[1], B[0]));
	}
	cout << ans<< endl;
}
#include<bits/stdc++.h> 
using namespace std;
namespace Sakurajima_Mai{
    #define ms(a) memset(a,0,sizeof(a))
    #define repi(i,a,b) for(int i=a,bbb=b;i<=bbb;++i)//attention reg int or reg ll ?
    #define repd(i,a,b) for(int i=a,bbb=b;i>=bbb;--i)
    #define reps(s) for(int i=head[s],v=e[i].to;i;i=e[i].nxt,v=e[i].to)
    #define ce(i,r) i==r?'\n':' '
    #define pb push_back 
    #define all(x) x.begin(),x.end()
    #define gmn(a,b) a=min(a,b)
    #define gmx(a,b) a=max(a,b)
    #define fi first
    #define se second                         
    typedef long long ll;
    typedef unsigned long long ull;
    typedef double db;
    const int infi=1e9;//infi较大，注意涉及inf相加时爆int
    const ll infl=4e18;
    inline ll ceil_div(ll a,ll b){ return (a+b-1)/b; }
    inline ll pos_mod(ll a,ll b){ return (a%b+b)%b; }
    //std::mt19937 rnd(time(0));//std::mt19937_64 rnd(time(0));
}
using namespace Sakurajima_Mai;
namespace Fast_Read{
    inline int qi(){
        int f=0,fu=1; char c=getchar();
        while(c<'0'||c>'9'){ if(c=='-')fu=-1; c=getchar(); }
        while(c>='0'&&c<='9'){ f=(f<<3)+(f<<1)+c-48; c=getchar(); }
        return f*fu;
    }
    inline ll ql(){
        ll f=0;int fu=1; char c=getchar();
        while(c<'0'||c>'9'){ if(c=='-')fu=-1; c=getchar(); }
        while(c>='0'&&c<='9'){ f=(f<<3)+(f<<1)+c-48; c=getchar(); }
        return f*fu;
    }
    inline db qd(){
        char c=getchar();int flag=1;double ans=0;
        while((!(c>='0'&&c<='9'))&&c!='-') c=getchar();
        if(c=='-') flag=-1,c=getchar();
        while(c>='0'&&c<='9') ans=ans*10+(c^48),c=getchar();
        if(c=='.'){c=getchar();for(int Bit=10;c>='0'&&c<='9';Bit=(Bit<<3)+(Bit<<1)) ans+=(double)(c^48)*1.0/Bit,c=getchar();}
        return ans*flag;
    }
}
namespace Read{
    #define si(a) scanf("%d",&a)
    #define sl(a) scanf("%lld",&a)
    #define sd(a) scanf("%lf",&a)
    #define ss(a) scanf("%s",a)
    #define rai(x,a,b) repi(i,a,b) x[i]=qi()
    #define ral(x,a,b) repi(i,a,b) x[i]=ql()
}
namespace Out{
    #define pi(x) printf("%d",x)
    #define pl(x) printf("%lld",x)
    #define ps(x) printf("%s",x)
    #define pc(x) printf("%c",x)
    #define pe() puts("")
}
namespace DeBug{
    #define MARK false
    #define DB if(MARK) 
    #define pr(x) cout<<#x<<": "<<x<<endl
    #define pra(x,a,b) cout<<#x<<": "<<endl; \
            repi(i,a,b) cout<<x[i]<<" ";     \
            puts("");   
    #define FR(a) freopen(a,"r",stdin)
    #define FO(a) freopen(a,"w",stdout)
}
using namespace Fast_Read;
using namespace Read;
using namespace Out;
using namespace DeBug;
typedef long double ld;//%Lf
const db pi=acos(-1.0);
const db eps=1e-8;
inline int sgn(db x){ return fabs(x)<eps?0:(x<0?-1:1); }
struct Point{
    #define Vec Point
    db x,y;
    Point(){}
    Point(db _x,db _y){x=_x,y=_y;}
    void input(){sd(x),sd(y);} 
    bool operator ==(Point b)const{return sgn(x-b.x)==0&&sgn(y-b.y)==0;}
    Point operator +(const Point &b)const{return Point(x+b.x,y+b.y);}
    Point operator -(const Point &b)const{return Point(x-b.x,y-b.y);}
    Point operator /(const db b)const{return Point(x/b,y/b);}
    Point operator *(const db b)const{return Point(x*b,y*b);}
    db operator ^(const Point &b)const{return x*b.y-y*b.x;}//叉乘
    db operator *(const Point &b)const{return x*b.x+y*b.y;}//点乘
    Point transXY(Point b,db B){//绕点b 逆时针 旋转角度B(弧度制)后的坐标
        db tx=x-b.x,ty=y-b.y;
        return Point(tx*cos(B)-ty*sin(B)+b.x,tx*sin(B)+ty*cos(B)+b.y);
    }
    db dis(Point p){ return sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y)); }//hypot(x-p.x,y-p.y)
};
int main()
{
    int n=qi();
    int x0=qi(),y0=qi(),xn2=qi(),yn2=qi();
    Point center=Point(1.0*(x0+xn2)/2,1.0*(y0+yn2)/2);
    db arc=2*pi/n;
    Point res=Point(1.0*x0,1.0*y0);
    res=res.transXY(center,arc);
    printf("%.10lf %.10lf\n",res.x,res.y);
    return 0;
}