/*******************************\
   Name:    REAJUL HAQUE REAYZ  |
   School:  COMILLA UNIVERSITY  |
            CSE (5TH BATCH)     |
********************************/
#include<bits/stdc++.h>
#define endl "\n"
#define inf 1<<30
#define pb push_back
#define mp make_pair
#define ss stringstream
#define pi acos(-1.0)
#define pI 2.0*acos(0.0)
#define PI 3.141592653589793238
#define all(v) v.begin(), v.end()
#define mem(x,y) memset(x , y , sizeof(x))
#define bit_cnt(mask) __builtin_popcount(mask)
using namespace std;
typedef long long ll;
typedef pair < int , int > pii;
typedef pair < ll , ll > pll;
const ll MOD = 1000000007; /// 1e9+7
const int MAX = 100005; ///1e5+5
ll bigmod(ll n, ll r)
{
    if(r==0) return 1;
    if(r==1) return n;
    if(r%2==0)
    {
        ll ret = bigmod(n, r/2);
        return ((ret%MOD) * (ret%MOD)) % MOD;
    }
    else return ((n%MOD) * (bigmod(n,r-1)%MOD)) % MOD;
}
ll modinverse(ll a){return bigmod(a,MOD-2)%MOD;}
ll lcm(ll a, ll b) {a=abs(a); b=abs(b); return (a/__gcd(a,b))*b;}
ll gcd(ll a, ll b) {a=abs(a); b=abs(b); if(!b) return a; return __gcd(b,a%b);}
int in() {int x; scanf("%d",&x); return x;}

struct Point{
    double x, y;
};
double dist(Point P, Point Q){
    return sqrt((P.x-Q.x)*(P.x-Q.x) + (P.y-Q.y)*(P.y-Q.y));
}
/// cw - 1, ccw - 2, linear - 0
int orientation(Point P, Point Q, Point R){
    double ret = (Q.y-P.y)*(R.x-Q.x) - (Q.x-P.x)*(R.y-Q.y);
    if(ret<0) return 2;
    else if(ret>0) return 1;
    else return ret;
}
/// angle of B
double angle(Point A, Point B, Point C){
    double c = dist(A,B);
    double a = dist(B,C);
    double b = dist(C,A);
    return acos((b*b-c*c-a*a)/(-2.0*a*c));
}
double DegToRad(double x){
    return ((pi*x)/180.0);
}
double RadToDeg(double x){
    return ((180.0*x)/pi);
}
int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
	return 0;
}


/*******************************\
   Name:    REAJUL HAQUE REAYZ  |
   School:  COMILLA UNIVERSITY  |
            CSE (5TH BATCH)     |
********************************/
#include<bits/stdc++.h>
#define endl "\n"
#define inf 1<<30
#define pi acos(-1.0)
#define pb push_back
#define mp make_pair
#define ss stringstream
#define all(v) v.begin(), v.end()
#define mem(x,y) memset(x,y,sizeof(x))
#define bit_cnt(mask) __builtin_popcount(mask)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MOD = 1000000007; /// 1e9+7
const int MAX = 100005;     /// 1e5+5
ll bigmod(ll n, ll r)
{
    if(r==0) return 1;
    if(r==1) return n;
    if(r%2==0)
    {
        ll ret = bigmod(n, r/2);
        return ((ret%MOD) * (ret%MOD)) % MOD;
    }
    else return ((n%MOD) * (bigmod(n,r-1)%MOD)) % MOD;
}
ll modinverse(ll a){return bigmod(a,MOD-2)%MOD;}
ll lcm(ll a, ll b) {a=abs(a); b=abs(b); return (a/__gcd(a,b))*b;}
ll gcd(ll a, ll b) {a=abs(a); b=abs(b); if(!b) return a; return __gcd(b,a%b);}
int in() {int x; scanf("%d",&x); return x;}

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n; cin>>n;
    int m; cin>>m;
    int a, b; cin>>a>>b;
    if(a!=0) cout<<"NO"<<endl, exit(0);
    if(m>=a and m<=b) cout<<"YES"<<endl, exit(0);
    int mx=b; n--;
    while(n--){
        int a, b; cin>>a>>b;
        if(a>mx){
            cout<<"NO"<<endl, exit(0);
        }
        else{
            mx=max(mx, b);
            if(m<=b) cout<<"YES"<<endl, exit(0);
        }
    }
    cout<<"NO"<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,a[105],b[105],c[105];
    memset(c,0,sizeof(c));
    bool f=true;
    cin>>n>>m;
    for(int i=0;i<n;i++)
    {
        cin>>a[i]>>b[i];
        for(int j=a[i];j<=b[i];j++) c[i]=1;
    }
    for(int i=0;i<m;i++)
    {
        if(!c[i])   {   f=false;    break;  }
    }
    if(f)   cout<<"YES\n";
    else cout<<"NO\n";
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,a[105],b[105];
    cin>>n>>m;
    bool f=true,t=false,y=false;
    cin>>a[0]>>b[0];
    if(!a[0])   y=true;
    if(a[0]>=m&&b[0]<=m)    t=true;
    for(int i=1;i<n;i++)
    {
        cin>>a[i]>>b[i];
        if(!a[i])   y=true;
        if(a[i]>b[i-1]) f=false;
        if(b[i]>=m)    {   t=true;  }
    }
    if((f&&t)&&y)   cout<<"YES\n";
    else    cout<<"NO\n";
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,a[105],b[105];
    cin>>n>>m;
    bool f=true,t=false,y=false;
    cin>>a[0]>>b[0];
    if(!a[0])   y=true;
    if(a[0]>=m&&b[0]<=m)    t=true;
    for(int i=1;i<n;i++)
    {
        cin>>a[i]>>b[i];
        if(!a[i])   y=true;
        if(a[i]>b[i-1]) f=false;
        if(b[i]<=m)    {   t=true;  }
    }
    if((f&&t)&&y)   cout<<"YES\n";
    else    cout<<"NO\n";
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,a[105],b[105];
    cin>>n>>m;
    bool f=true,t=false,y=false;
    cin>>a[0]>>b[0];
    if(!a[0])   y=true;
    if(a[0]>=m&&b[0]<=m)    t=true;
    for(int i=1;i<n;i++)
    {
        cin>>a[i]>>b[i];
        if(!a[i])   y=true;
        if(a[i]>b[i-1]) f=false;
        if(a[i]<=m&&b[i]>=m)    {   t=true;  }
    }
    if((f&&t)&&y)   cout<<"YES\n";
    else    cout<<"NO\n";
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,a[105],b[105],c[105];
    memset(c,0,sizeof(c));
    bool f=true;
    cin>>n>>m;
    for(int i=0;i<n;i++)
    {
        cin>>a[i]>>b[i];
        for(int j=a[i];j<=b[i];j++) c[j]=1;
    }
    for(int i=0;i<m;i++)
    {
        if(!c[i])   {   f=false;    break;  }
    }
    if(f)   cout<<"YES\n";
    else cout<<"NO\n";
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,a[105],b[105];
    cin>>n>>m;
    bool f=true,t=false;
    cin>>a[0]>>b[0];
    if(a[0]>=m&&b[0]<=m)    t=true;
    for(int i=1;i<n;i++)
    {
        cin>>a[i]>>b[i];
        if(a[i]>b[i-1]) f=false;
        if(b[i]<=m)    {   t=true;  }
    }
    if(f&&t)   cout<<"YES\n";
    else    cout<<"NO\n";
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,a[105],b[105],c[105];
    memset(c,0,sizeof(c));
    bool f=true;
    cin>>n>>m;
    for(int i=0;i<n;i++)
    {
        cin>>a[i]>>b[i];
        for(int j=a[i];j<=b[i];j++) c[j]=1;
    }
    for(int i=0;i<=m;i++)
    {
        if(!c[i])   {   f=false;    break;  }
    }
    if(f)   cout<<"YES\n";
    else cout<<"NO\n";
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,a[105],b[105],c[105];
    memset(c,0,sizeof(c));
    bool f=true,fl=false;
    cin>>n>>m;
    for(int i=0;i<n;i++)
    {
        cin>>a[i]>>b[i];
        if(b[i]==m) fl=true;
        for(int j=a[i];j<b[i];j++) c[j]=1;
    }
    for(int i=0;i<m;i++)
    {
        if(!c[i])   {   f=false;    break;  }
    }
    if(f&&fl)   cout<<"YES\n";
    else cout<<"NO\n";
}


#include <bits/stdc++.h>
using namespace std;

int main (void){
    int n, m;
    cin>> n >> m;
    int A[n];
    int B[n];
    int ans;
    ans=0;
    for (int i=0; i<n; i++){
        int aux1, aux2;
        cin>> aux1 >> aux2;
        A[i]=aux1;
        B[i]=aux2;
    }
    for (int i=0; i<=m; i++){
        for (int j=0; j<n; j++){
            if (A[j]<=i && i<=B[j]){
                i=B[j];
                if (i==m){
                    cout<< "YES\n";
                    return 0;
                }
            }
            else if (j==n-1) ans=1;
        }
    }
    if (ans==1) cout<< "NO \n";
    else cout<< "YES \n";
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main (void){
    int n, m;
    cin>> n >> m;
    int A[n];
    int B[n];
    int ans;
    ans=0;
    for (int i=0; i<n; i++){
        int aux1, aux2;
        cin>> aux1 >> aux2;
        A[i]=aux1;
        B[i]=aux2;
    }
    for (int i=0; i<=m; i++){
        for (int j=0; j<n; j++){
            if (A[j]<=i && i<=B[j]){
                i=B[j];
            }
            else if (j==n-1) ans=1;
        }
    }
    if (ans==1) cout<< "NO \n";
    else cout<< "YES \n";
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main (void){
    int n, m;
    cin>> n >> m;
    int A[n];
    int B[n];
    int ans;
    ans=0;
    for (int i=0; i<n; i++){
        int aux1, aux2;
        cin>> aux1 >> aux2;
        A[i]=aux1;
        B[i]=aux2;
    }
    for (int i=0; i<=m; i++){
        for (int j=0; j<n; j++){
            if (A[j]<=i && i<=B[j]){
                i=B[j];
                if (i==m){
                    cout<< "YES\n";
                    return 0;
                }
            }
            else if (j==n-1) {
                cout<< "NO\n";
                return 0;
            }
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main (void){
    int n,m;
    int A[100];
    int B[100];
    memset (A, 0, sizeof A),
    memset (B, 0, sizeof B);
    cin>> n >> m;
    for (int i=0; i<n; i++){
        int auxa, auxb;
        cin>> auxa >> auxb;
        A[i]=auxa;
        B[i]=auxb;
    }
    if (B[n-1]!=m || A[0]!=0){
        cout<< "NO \n";
    }
    else{
        for (int i=1; i<n; i++){
            if (A[i]>B[i]-1){
                cout<< "NO \n";
                return 0;
            }
        }
        cout<< "YES \n";
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main (void){
    int n,m;
    int A[100];
    int B[100];
    memset (A, 0, sizeof A),
    memset (B, 0, sizeof B);
    cin>> n >> m;
    for (int i=0; i<n; i++){
        int auxa, auxb;
        cin>> auxa >> auxb;
        A[i]=auxa;
        B[i]=auxb;
    }
    if (B[n-1]!=m || A[0]!=0){
        cout<< "NO \n";
    }
    else{
        for (int i=1; i<n; i++){
            if (A[i]>B[i-1]){
                cout<< "NO \n";
                return 0;
            }
        }
        cout<< "YES \n";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[110];
int main()
{
	int n,m,x,y;
	scanf("%d%d",&n,&m);
	for(int i=0;i<n;i++)
	{
		scanf("%d%d",&x,&y);
		for(int k=x;k<y;k++)
			a[k]++;
		if(y==m)
			a[y]++;
	}
	int flag=1;
	for(int i=0;i<=m;i++)
	{
		if(a[i]==0)
			flag=0;
	}
	if(flag)
		printf("YES\n");
	else
		printf("NO\n");
	return 0;
 }


#include<bits/stdc++.h>
using namespace std;
struct node{
	int x;
	int y;
}nn[110];
int main()
{
	int n,m,x,y;
	scanf("%d%d",&n,&m);
	for(int i=0;i<n;i++)
		scanf("%d%d",&nn[i].x,&nn[i].y);
	int flag=1;
	if(nn[0].x>0)
		printf("NO\n");
	else
	{
		for(int i=1;i<n;i++)
		{
			if(nn[i-1].y>=m)
				break;
			if(nn[i].x>nn[i-1].y)
				flag=0;
		}
		if(nn[n-1].y<m)
			flag=0;
		if(flag)
			printf("YES\n");
		else
			printf("NO\n");
	}
	return 0;
 }


#include<bits/stdc++.h>
using namespace std;
struct node{
	int x;
	int y;
}nn[110];
int cmp(node xx,node yy)
{
	return xx.x<yy.x;
}
int main()
{
	int n,m,x,y;
	scanf("%d%d",&n,&m);
	for(int i=0;i<n;i++)
	{
		scanf("%d%d",&nn[i].x,&nn[i].y);
	}
	sort(nn,nn+n,cmp);
	if(nn[0].x>0)
		printf("NO\n");
	else
	{
		int mi=nn[0].x;
		int ma=nn[0].y;
		if(ma>m)
		{
			printf("YES\n");
			return 0;
		}
		else
		{
			for(int k=1;k<n;k++)
			{
				int temp=nn[k].x;
				if(temp<=ma)
				{
					if(nn[k].y>ma)
						ma=nn[k].y;
				}
				else
				{
					printf("NO\n");
					return 0;
				}
			}
		}
	}
	return 0;
 }


#include<bits/stdc++.h>
using namespace std;
struct node{
	int x;
	int y;
}nn[110];
int cmp(node xx,node yy)
{
	return xx.x<yy.x;
}
int main()
{
	int n,m,x,y;
	scanf("%d%d",&n,&m);
	for(int i=0;i<n;i++)
		scanf("%d%d",&nn[i].x,&nn[i].y);
	sort(nn,nn+n,cmp);
	if(nn[0].x>0)
		printf("NO\n");
	else
	{
		int mi=nn[0].x;
		int ma=nn[0].y;
		if(ma>m)
		{
			printf("YES\n");
			return 0;
		}
		else
		{
			for(int k=1;k<n;k++)
			{
				int temp=nn[k].x;
				if(temp<=ma)
				{
					if(nn[k].y>ma)
						ma=nn[k].y;
				}
				else
				{
					printf("NO\n");
					return 0;
				}
				if(ma>=m)
				{
					printf("YES\n");
					return 0;
				}
			}
			printf("NO\n");
		}
	}
	return 0;
 }


#include<bits/stdc++.h>
using namespace std;
struct node{
	int x;
	int y;
}nn[110];
int main()
{
	int n,m,x,y;
	scanf("%d%d",&n,&m);
	for(int i=0;i<n;i++)
		scanf("%d%d",&nn[i].x,&nn[i].y);
	int flag=1;
	if(nn[0].x>0)
		printf("NO\n");
	else
	{
		for(int i=1;i<n;i++)
		{
			if(nn[i].x>nn[i-1].y)
				flag=0;
		}
		if(nn[n-1].y<m)
			flag=0;
		if(flag)
			printf("YES\n");
		else
			printf("NO\n");
	}
	return 0;
 }


#include<bits/stdc++.h>
using namespace std;
struct node{
	int x;
	int y;
}nn[110];
int cmp(node xx,node yy)
{
	return xx.x<yy.x;
}
int main()
{
	int n,m,x,y;
	scanf("%d%d",&n,&m);
	for(int i=0;i<n;i++)
	{
		scanf("%d%d",&nn[i].x,&nn[i].y);
	}
	sort(nn,nn+n,cmp);
	if(nn[0].x>0)
		printf("NO\n");
	else
	{
		int mi=nn[0].x;
		int ma=nn[0].y;
		if(ma>m)
		{
			printf("YES\n");
			return 0;
		}
		else
		{
			for(int k=1;k<n;k++)
			{
				int temp=nn[k].x;
				if(temp<=ma)
				{
					if(nn[k].y>ma)
						ma=nn[k].y;
				}
				else
				{
					printf("NO\n");
					return 0;
				}
			}
			printf("YES\n");
		}
	}
	return 0;
 }


#include<bits/stdc++.h>
using namespace std;

main(){

int n,m,x,y;
vector<pair<int,int> >arr;
    cin>>n>>m;

    for(int i=0;i<n;i++){
        cin>>x>>y;
        arr.push_back(make_pair(x,y));
    }

   if(arr[0].first !=0){
    cout<<"NO"<<'\n';
            return 0;
   }
    y=arr[0].second;
    for(int i=1;i<n;i++){
        int x1=arr[i].first;
        int y1=arr[i].second;
        if(x1>y){
            cout<<"NO"<<'\n';
            return 0;
        }
        //cout<<x1<<" "<<y1<<endl;
        y=y1;
        if(y>=m){
            cout<<"YES"<<'\n';
            return 0;
        }

    }

cout<<"YES"<<'\n';
return 0;}


#include<bits/stdc++.h>
using namespace std;

main(){

int n,m,x,y;
vector<pair<int,int> >arr;
    cin>>n>>m;

    for(int i=0;i<n;i++){
        cin>>x>>y;
        arr.push_back(make_pair(x,y));
    }

   if((n==1 && y<m)||arr[0].first !=0){
    cout<<"NO"<<'\n';
            return 0;
   }
   if(n==1 && y>=m){
    cout<<"YES"<<'\n';
            return 0;
   }
    y=arr[0].second;
    for(int i=1;i<n;i++){
        int x1=arr[i].first;
        int y1=arr[i].second;
        if(x1>y){
            cout<<"NO"<<'\n';
            return 0;
        }
        //cout<<x1<<" "<<y1<<endl;
        y=y1;
        if(y>=m){
            cout<<"YES"<<'\n';
            return 0;
        }

    }

cout<<"NO"<<'\n';
return 0;}


#include<bits/stdc++.h>
using namespace std;

main(){

int n,m,x,y;
vector<pair<int,int> >arr;
    cin>>n>>m;

    for(int i=0;i<n;i++){
        cin>>x>>y;

        arr.push_back(make_pair(x,y));
       // cout<<i<<" "<<arr[i].first<<" "<<arr[i].second<<endl;
    }
   // sort(arr.begin(),arr.end());
   if((n==1 && y<m) || arr[0].first !=0){
    cout<<"N0"<<'\n';
            return 0;
   }
    x=arr[0].first;
    y=arr[0].second;
    for(int i=1;i<n;i++){
        int x1=arr[i].first;
        int y1=arr[i].second;
        if(x1>y){
            cout<<"N0"<<'\n';
            return 0;
        }
        //cout<<x1<<" "<<y1<<endl;
        y=y1;

    }

    cout<<"YES"<<'\n';
return 0;}


#include<bits/stdc++.h>
using namespace std;

main(){

int n,m,x,y;
vector<pair<int,int> >arr;
    cin>>n>>m;

    for(int i=0;i<n;i++){
        cin>>x>>y;

        arr.push_back(make_pair(x,y));
       // cout<<i<<" "<<arr[i].first<<" "<<arr[i].second<<endl;
    }
    sort(arr.begin(),arr.end());
    x=arr[0].first;
    y=arr[0].second;
    for(int i=0;i<n;i++){
        int x1=arr[i].first;
        int y1=arr[i].second;
        if(x1>y){
            cout<<"N0"<<'\n';
            return 0;
        }
        //cout<<x1<<" "<<y1<<endl;
        y=y1;

    }

    cout<<"YES"<<'\n';
return 0;}


#include<bits/stdc++.h>
using namespace std;

main(){

int n,m,x,y;
vector<pair<int,int> >arr;
    cin>>n>>m;

    for(int i=0;i<n;i++){
        cin>>x>>y;
        arr.push_back(make_pair(x,y));
    }

   if(arr[0].first !=0){
    cout<<"NO"<<'\n';
            return 0;
   }
    y=arr[0].second;
    for(int i=1;i<n;i++){
        int x1=arr[i].first;
        int y1=arr[i].second;
        if(x1>y){
            cout<<"NO"<<'\n';
            return 0;
        }
        //cout<<x1<<" "<<y1<<endl;
        y=y1;
        if(y>=m){
            cout<<"YES"<<'\n';
            return 0;
        }

    }

cout<<"NO"<<'\n';
return 0;}


#include<bits/stdc++.h>
using namespace std;

main(){

int n,m,x,y;
vector<pair<int,int> >arr;
    cin>>n>>m;

    for(int i=0;i<n;i++){
        cin>>x>>y;
        arr.push_back(make_pair(x,y));
    }

   if((n==1 && y<m)||arr[0].first !=0){
    cout<<"NO"<<'\n';
            return 0;
   }
   if(n==1 && y>=m){
    cout<<"YES"<<'\n';
            return 0;
   }
    y=arr[0].second;
    for(int i=1;i<n;i++){
        int x1=arr[i].first;
        int y1=arr[i].second;
        if(x1>y){
            cout<<"NO"<<'\n';
            return 0;
        }
        //cout<<x1<<" "<<y1<<endl;
        y=max(y,y1);
        if(y>=m){
            cout<<"YES"<<'\n';
            return 0;
        }

    }

cout<<"NO"<<'\n';
return 0;}


#include<bits/stdc++.h>
using namespace std;

main(){

int n,m,x,y;
vector<pair<int,int> >arr;
    cin>>n>>m;

    for(int i=0;i<n;i++){
        cin>>x>>y;
        arr.push_back(make_pair(x,y));
    }

   if(y<m || arr[0].first !=0){
    cout<<"NO"<<'\n';
            return 0;
   }
    y=arr[0].second;
    for(int i=1;i<n;i++){
        int x1=arr[i].first;
        int y1=arr[i].second;
        if(x1>y){
            cout<<"NO"<<'\n';
            return 0;
        }
        //cout<<x1<<" "<<y1<<endl;
        y=y1;
        if(y>=m){
            cout<<"YES"<<'\n';
            return 0;
        }

    }

cout<<"YES"<<'\n';
return 0;}


#include<bits/stdc++.h>
using namespace std;

main(){

int n,m,x,y;
vector<pair<int,int> >arr;
    cin>>n>>m;

    for(int i=0;i<n;i++){
        cin>>x>>y;
        arr.push_back(make_pair(x,y));
    }

   if(y<m || arr[0].first !=0){
    cout<<"NO"<<'\n';
            return 0;
   }
    y=arr[0].second;
    for(int i=1;i<n;i++){
        int x1=arr[i].first;
        int y1=arr[i].second;
        if(x1>y){
            cout<<"NO"<<'\n';
            return 0;
        }
        //cout<<x1<<" "<<y1<<endl;
        y=y1;

    }

cout<<"YES"<<'\n';
return 0;}


#include<bits/stdc++.h>
using namespace std;

main(){

int n,m,x,y;
vector<pair<int,int> >arr;
    cin>>n>>m;

    for(int i=0;i<n;i++){
        cin>>x>>y;
        arr.push_back(make_pair(x,y));
    }

   if((n==1 && y<m) || arr[0].first !=0){
    cout<<"N0"<<'\n';
            return 0;
   }
    y=arr[0].second;
    for(int i=1;i<n;i++){
        int x1=arr[i].first;
        int y1=arr[i].second;
        if(x1>y){
            cout<<"N0"<<'\n';
            return 0;
        }
        //cout<<x1<<" "<<y1<<endl;
        y=y1;

    }
if(y<m)cout<<"N0"<<'\n';
else cout<<"YES"<<'\n';
return 0;}


#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
#include <climits>

using namespace std;

int main(){
   	ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0);
   	int n, m;
   	int a[105], b[105];
   	cin >> n >> m;
   	for(int i = 0; i < n; i++){
   		cin >> a[i] >> b[i];
   	}

   	for(int i = 1; i < n; i++){
   		if(a[i] > b[i-1]){
   			break;
   		}
   		else if(b[i] >= m && a[i] <= m){
   			cout << "YES\n";
   			return 0;
   		}
   	}
   	if(m >= a[0] && m <= b[0])
   		cout << "YES\n";
   	else
   		cout << "NO\n";
	return 0;
}


#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
#include <climits>

using namespace std;

int main(){
   	ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0);
   	int n, m;
   	int a[105], b[105];
   	cin >> n >> m;
   	for(int i = 0; i < n; i++){
   		cin >> a[i] >> b[i];
   	}

   	if(a[0] != 0){
   		cout << "NO\n";
   		return 0;
   	}

   	for(int i = 1; i < n; i++){
   		if(a[i] > b[i-1]){
   			break;
   		}
   		else if(b[i] >= m && a[i] <= m){
   			cout << "YES\n";
   			return 0;
   		}
   	}
   	if(m >= a[0] && m <= b[0])
   		cout << "YES\n";
   	else
   		cout << "NO\n";
	return 0;
}


#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
#include <climits>

using namespace std;

int main(){
   	ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0);
   	int n, m;
   	int a[105], b[105];
   	cin >> n >> m;
   	for(int i = 0; i < n; i++){
   		cin >> a[i] >> b[i];
   	}

   	for(int i = 1; i < n; i++){
   		if(a[i] > b[i-1]){
   			break;
   		}
   		else if(b[i] <= m){
   			cout << "YES\n";
   			return 0;
   		}
   	}
   	cout << "NO\n";
	return 0;
}


#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
#include <climits>

using namespace std;

int main(){
   	ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0);
   	int n, m;
   	int a[105], b[105];
   	cin >> n >> m;
   	for(int i = 0; i < n; i++){
   		cin >> a[i] >> b[i];
   	}

   	for(int i = 1; i < n; i++){
   		if(a[i] > b[i-1]){
   			break;
   		}
   		else if(b[i] == m){
   			cout << "YES\n";
   			return 0;
   		}
   	}
   	cout << "NO\n";
	return 0;
}


#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
#include <climits>

using namespace std;

int main(){
   	ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0);
   	int n, m;
   	int a[105], b[105];
   	cin >> n >> m;
   	for(int i = 0; i < n; i++){
   		cin >> a[i] >> b[i];
   	}

   	for(int i = 1; i < n; i++){
   		if(a[i] > b[i-1]){
   			break;
   		}
   		else if(b[i] <= m && a[i] >= m){
   			cout << "YES\n";
   			return 0;
   		}
   	}
   	cout << "NO\n";
	return 0;
}


#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
#include <climits>

using namespace std;

int main(){
   	ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0);
   	int n, m;
   	int a[105], b[105];
   	cin >> n >> m;
   	for(int i = 0; i < n; i++){
   		cin >> a[i] >> b[i];
   	}
   	int maxb = b[0];
   	if(a[0] != 0 ){
   		cout << "NO\n";
   		return 0;
   	}
   	else if(m >= a[0] && m <= b[0]){
   		cout << "YES\n";
   		return 0;
   	}

   	for(int i = 1; i < n; i++){
   		if(a[i] > maxb){
   			cout << "NO\n";
   			return 0;
   		}
   		maxb = max(maxb, b[i]);
   		if(m >= a[i] && m <= maxb){
   			cout << "YES\n";
   			return 0;
   		}
   	}
   	cout << "NO\n";
	return 0;
}


#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
#include <climits>

using namespace std;

int main(){
   	ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0);
   	int n, m;
   	int a[105], b[105];
   	cin >> n >> m;
   	for(int i = 0; i < n; i++){
   		cin >> a[i] >> b[i];
   	}

   	for(int i = 1; i < n; i++){
   		if(a[i] > b[i-1]){
   			break;
   		}
   		else if(b[i] >= m && a[i] <= m){
   			cout << "YES\n";
   			return 0;
   		}
   	}
   	cout << "NO\n";
	return 0;
}


#include <iostream>
using namespace std;
int main() {
  int home, tels;
  cin >> tels >> home;
  int tel[tels][2];
  for(int i = 0; i < tels; i++) {
  	cin >> tel[i][0] >> tel[i][1];
  }
  bool flag = true;
  for(int i = 0; i < tels - 1; i++) {
  	if(tel[i][1] < tel[i + 1][0]) {
  	  flag = false;
  	  break;
	}
  }
  if(tel[tels - 1][1] < home || tel[0][0]) {
  	flag = false;
  }
  if(flag) {
  	cout << "YES";
  }
  else {
  	cout << "NO";
  }
  return 0;
}


#include <iostream>
using namespace std;
int main() {
  int nt, home;
  cin >> nt >> home;
  int ranges[nt], locs[nt];
  bool arr[nt], flag = false;
  for(int i = 0; i < nt; i++) {
  	arr[i] = 0;
  }
  for(int i = 0; i < nt; i++) {
  	 cin >> locs[i] >> ranges[i];
  }
  arr[0] = 1;
  	for(int i = 0; i < nt; i++) {
  	  if(arr[i]) {

  	  for(int j = i + 1; j < nt && ranges[i] >= locs[j]; j++) {
  	  	arr[j] = 1;
	  }
      }
    }
  for(int i = 0; i < nt; i++) {
  	if(arr[i] && ranges[i] >= home) {
  		flag = true;
	  }
  }
  if(flag) {
  	cout << "YES";
  }
  else {
  	cout << "NO";
  }
  return 0;
}


#include <iostream>
using namespace std;
int main() {
  int nt, home;
  cin >> nt >> home;
  int ranges[nt], locs[nt];
  bool arr[nt], flag = false;
  for(int i = 0; i < nt; i++) {
  	arr[i] = 0;
  }
  for(int i = 0; i < nt; i++) {
  	 cin >> locs[i] >> ranges[i];
  }
  arr[0] = 1;
  	for(int i = 0; i < nt; i++) {
  	  if(arr[i]) {

  	  for(int j = i + 1; j < nt && ranges[i] >= locs[j]; j++) {
  	  	arr[j] = 1;
	  }
      }
    }
  for(int i = 0; i < nt; i++) {
  	if(arr[i] && ranges[i] >= home) {
  		flag = true;
	  }
  }
  if(flag && !locs[0]) {
  	cout << "YES";
  }
  else {
  	cout << "NO";
  }
  return 0;
}


#include <iostream>
using namespace std;
bool answer(int notels, int ranges[], int locations[], int currentloc, int currentlocindex, int dest) {
  if(ranges[currentlocindex] >= dest) {
  	return true;
  }
  for(int i = currentlocindex + 1; i < notels && ranges[currentlocindex] >= locations[i]; i++) {
    if(answer(notels, ranges, locations, locations[i], i, dest)) {
   	  return true;
	}
  }
  return false;
}
int main() {
  int home, notels;
  cin >> notels >> home;
  int ranges[notels], locations[notels];
  for(int i = 0; i < notels; i++) {
  	cin >> locations[i] >> ranges[i];
  }
  bool ans = answer(notels, ranges, locations, 0, 0, home);
  if(ans) {
  	cout << "YES";
  }
  else {
  	cout << "NO";
  }
  return 0;
}


#include <iostream>
using namespace std;
bool answer(int notels, int ranges[], int locations[], int currentloc, int currentlocindex, int dest) {
  if(ranges[currentlocindex] >= dest) {
  	return true;
  }
  for(int i = currentlocindex + 1; i < notels; i++) {
  	if(ranges[currentlocindex] >= locations[i]) {
  		if(answer(notels, ranges, locations, locations[i], i, dest)) {
  			return true;
		  }
	  }
  }
  return false;
}
int main() {
  int home, notels;
  cin >> notels >> home;
  int ranges[notels], locations[notels];
  for(int i = 0; i < notels; i++) {
  	cin >> locations[i] >> ranges[i];
  }
  bool ans = answer(notels, ranges, locations, 0, 0, home);
  if(ans) {
  	cout << "YES";
  }
  else {
  	cout << "NO";
  }
  return 0;
}


#include<bits/stdc++.h>
using namespace std;
//long long a[1001]={};
int main()
{
	int n,m,a[101]={},b[101]={};
	cin>>n>>m;
	bool f=0;int r=0;
	for(int i =0;i<n;i++)
	{
		cin>>a[i]>>b[i];

	}
	if(a[0]!=0)
	{
		cout<<"NO";
		return 0;
	}
	r=b[0];
		if(m<=r)
	{
		cout<<"YES";
		return 0;
	}
	for(int i=1;i<n;i++)
	{
		if(a[i]>r)
		{
			cout<<"NO";
			return 0;
		}
		r=max(r,b[i]);
		if(m<=r)
	{
		cout<<"YES";
		return 0;
	}
	}
	cout<<"NO";
}


#include<bits/stdc++.h>
using namespace std;
//long long a[1001]={};
int main()
{
	int n,m,a[101]={},b[101]={};
	cin>>n>>m;
	bool f=0;int r=0;
	for(int i =0;i<n;i++)
	{
		cin>>a[i]>>b[i];

	}
	if(a[0]!=0)
	{
		cout<<"NO";
		return 0;
	}
	r=b[0];
		if(m<=r)
	{
		cout<<"YES";
		return 0;
	}
	for(int i=1;i<n;i++)
	{
		if(a[i]>r)
		{
			cout<<"NO";
			return 0;
		}
		r=b[i];
		if(m<=r)
	{
		cout<<"YES";
		return 0;
	}
	}
	cout<<"NO";
}


#include<bits/stdc++.h>
using namespace std;
//long long a[1001]={};
int main()
{
	int n,m,a[101]={},b[101]={};
	cin>>n>>m;
	bool f=0;int r=0;
	for(int i =0;i<n;i++)
	{
		cin>>a[i]>>b[i];

	}
/*	if(a[0]!=0)
	{
		cout<<"NO";
		return 0;
	}*/
	r=b[0];

	for(int i=1;i<n;i++)
	{
		if(a[i]>r)
		{
			cout<<"NO";
			return 0;
		}
		r=b[i];
		if(m<=r)
	{
		cout<<"YES";
		return 0;
	}
	}
	cout<<"NO";
}


#include<bits/stdc++.h>
using namespace std;
//long long a[1001]={};
int main()
{
	int n,m,a[101]={},b[101]={};
	cin>>n>>m;
	bool f=0;int r=0;
	for(int i =0;i<n;i++)
	{
		cin>>a[i]>>b[i];

	}
	if(a[0]!=0)
	{
		cout<<"NO";
		return 0;
	}
	r=b[0];

	for(int i=1;i<n;i++)
	{
		if(a[i]>r)
		{
			cout<<"NO";
			return 0;
		}
		r=b[i];
		if(m<=r)
	{
		cout<<"YES";
		return 0;
	}
	}
	cout<<"NO";
}


#include<bits/stdc++.h>
using namespace std;
//long long a[1001]={};
int main()
{
	int n,m,a[101]={},b[101]={};
	cin>>n>>m;
	bool f=0;int r=0;
	for(int i =0;i<n;i++)
	{
		cin>>a[i]>>b[i];

	}
	if(a[0]!=0)
	{
		cout<<"NO";
		return 0;
	}
	r=b[0];

	for(int i=1;i<n;i++)
	{
		if(a[i]>r)
		{
			cout<<"NO";
			return 0;
		}
		r=max(r,b[i]);
		if(m<=r)
	{
		cout<<"YES";
		return 0;
	}
	}
	cout<<"NO";
}


#include<bits/stdc++.h>

using namespace std;
vector<pair<int, int> >v1;
vector<int>v2;

int main(){
    int i, j, n, m, k, l, a, b;

    cin >> n >> m;

    for(i = 0; i < n; i++){
        cin >> a >> b;
        v1.push_back(make_pair(a, b));
        v2.push_back(b);

    }

    if(v1[0].first != 0){
       printf("NO\n");
       return 0;
    }

    if(n == 1){
       if(v1[0].second < m){
          printf("NO\n");
          return 0;
       }
       else{
          printf("YES\n");
          return 0;
       }
    }

    if(v1[0].second >= m){
       printf("YES\n");
       return 0;
    }
    //sort(v2.begin(), v2.end());

    for(i = 1; i < v1.size(); i++){
       if(v1[i].first > v1[i-1].second){
           printf("NO\n");
           return 0;
       }
       if(v1[i].second >= m){
          printf("YES\n");
          return 0;
       }
    }

    sort(v2.begin(), v2.end());
    /*if(v1[v1.size()-1].second < m){
       printf("NO\n");
       return 0;
    }
    else{
       printf("YES\n");
       return 0;
    }*/

    if(v2[v2.size()-1] < m){
       printf("NO\n");
       return 0;
    }
    else{
       printf("YES\n");
       return 0;
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

vector<pair<int, int> >v1;

int main(){
    int n, m, i, j, a, b;
    cin >> n >> m;

    for(i = 0; i < n; i++){
         cin >> a >> b;

         v1.push_back(make_pair(a, b));
    }

    if(v1[0].first != 0){
       printf("NO\n");
       return 0;
    }

    if(v1[0].second == m){
       printf("YES\n");
       return 0;
    }

    int max1 = v1[0].second;
    for(i = 1; i < v1.size(); i++){
        if(v1[i].first > max1){
           printf("NO\n");
           return 0;
        }

        if(v1[i].second >= m){
           printf("YES\n");
           return 0;
        }
        max1 = max(max1, v1[i].second);
    }

    if(max1 >= m){
       printf("YES\n");
       return 0;
    }
    else{
       printf("NO\n");
       return 0;
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;
vector<pair<int, int> >v1;
vector<int>v2;

int main(){
    int i, j, n, m, k, l, a, b, max1;

    cin >> n >> m;

    for(i = 0; i < n; i++){
        cin >> a >> b;
        v1.push_back(make_pair(a, b));
        v2.push_back(b);

    }

    if(v1[0].first != 0){
       printf("NO\n");
       return 0;
    }

    if(n == 1){
       if(v1[0].second < m){
          printf("NO\n");
          return 0;
       }
       else{
          printf("YES\n");
          return 0;
       }
    }

    if(v1[0].second >= m){
       printf("YES\n");
       return 0;
    }
    //sort(v2.begin(), v2.end());
    max1 = v1[0].second;
    for(i = 1; i < v1.size(); i++){
       if(v1[i].first > max1){
           printf("NO\n");
           return 0;
       }
       if(v1[i].second >= m){
          printf("YES\n");
          return 0;
       }
       max1 = max(max1, v1[i].second);
    }

    //sort(v2.begin(), v2.end());
    /*if(v1[v1.size()-1].second < m){
       printf("NO\n");
       return 0;
    }
    else{
       printf("YES\n");
       return 0;
    }*/

    /*if(v2[v2.size()-1] < m){
       printf("NO\n");
       return 0;
    }
    else{
       printf("YES\n");
       return 0;
    }*/
    return 0;
}


#include<bits/stdc++.h>

using namespace std;
vector<pair<int, int> >v1;
vector<int>v2;

int main(){
    int i, j, n, m, k, l, a, b;

    cin >> n >> m;

    for(i = 0; i < n; i++){
        cin >> a >> b;
        v1.push_back(make_pair(a, b));
        v2.push_back(b);

    }

    if(v1[0].first != 0){
       printf("NO\n");
       return 0;
    }

    if(n == 1){
       if(v1[0].second < m){
          printf("NO\n");
          return 0;
       }
       else{
          printf("YES\n");
          return 0;
       }
    }

    for(i = 1; i < v1.size(); i++){
       if(v1[i].first > v1[i-1].second){
           printf("NO\n");
           return 0;
       }
    }

    sort(v2.begin(), v2.end());
    /*if(v1[v1.size()-1].second < m){
       printf("NO\n");
       return 0;
    }
    else{
       printf("YES\n");
       return 0;
    }*/

    if(v2[v2.size()-1] < m){
       printf("NO\n");
       return 0;
    }
    else{
       printf("YES\n");
       return 0;
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;
vector<pair<int, int> >v1;

int main(){
    int i, j, n, m, k, l, a, b;

    cin >> n >> m;

    for(i = 0; i < n; i++){
        cin >> a >> b;
        v1.push_back(make_pair(a, b));

    }

    if(v1[0].first != 0){
       printf("NO\n");
       return 0;
    }

    if(n == 1){
       if(v1[0].second < m){
          printf("NO\n");
          return 0;
       }
       else{
          printf("YES\n");
          return 0;
       }
    }

    for(i = 1; i < v1.size(); i++){
       if(v1[i].first > v1[i-1].second){
           printf("NO\n");
           return 0;
       }
    }

    if(v1[v1.size()-1].second < m){
       printf("NO\n");
       return 0;
    }
    else{
       printf("YES\n");
       return 0;
    }
    return 0;
}


#include <cstdio>

bool flag[110];
int a[110],b[110];

int main()
{
        int n,m;
        scanf("%d%d",&n,&m);

        for (int i = 0; i<n; i++)
                scanf("%d%d",&a[i],&b[i]);
        a[n] = m;

        if (a[0]==0)
                flag[0] = true;

        int c[1000];
        c[1] = 0;
        int head = 1,tail = 1;
        while (head<=tail)
        {
                for (int i = c[head]+1; a[i]<= b[c[head]] && i<=n; i++)
                        if (!flag[i])
                        {
                                //printf("!!! %d\n",i);
                                c[++tail] = i;
                                flag[i] = true;
                        }
                head ++;
        }

        if (flag[n])
                printf("YES");
        else printf("NO");

    return 0;
}


#include <cstdio>
#include <algorithm>

using namespace std;

struct P
{
        int a,b;

        const bool operator < (const P& tmp)const{
                return this->a < tmp.a;
        }
}p[110];

int main()
{
        int n,m;
        scanf("%d%d",&n,&m);
        for (int i = 0; i<n; i++)
        scanf("%d%d",&p[i].a,&p[i].b);
        p[n].a = m;

        bool ans = true;
        for (int i = 1; i<=n; i++)
        {
                if (p[i-1].b<p[i].a)
                        ans = false;
        }

        if (ans)
                printf("YES");
        else printf("NO");

        return 0;
}


#include <cstdio>

bool flag[110];
int a[110],b[110];

int main()
{
        int n,m;
        scanf("%d%d",&n,&m);

        for (int i = 0; i<n; i++)
                scanf("%d%d",&a[i],&b[i]);
        a[n] = m;

        int c[1000];
        int head = 1,tail=0;
        if (a[0]==0)
        {
                flag[0] = true;
        		c[1] = 0;
        		tail = 1;
        }
        while (head<=tail)
        {
                for (int i = c[head]+1; a[i]<= b[c[head]] && i<=n; i++)
                        if (!flag[i])
                        {
                                //printf("!!! %d\n",i);
                                c[++tail] = i;
                                flag[i] = true;
                        }
                head ++;
        }

        if (flag[n])
                printf("YES");
        else printf("NO");

    return 0;
}


#include <cstdio>
#include <algorithm>

using namespace std;

struct P
{
        int a,b;

        const bool operator < (const P& tmp)const{
                return this->a < tmp.a;
        }
}p[110];

int main()
{
        int n,m;
        scanf("%d%d",&n,&m);
        for (int i = 0; i<n; i++)
        scanf("%d%d",&p[i].a,&p[i].b);
        p[n].a = m;

        bool ans = true;
        int t = 0;
        for (int i = 1; i<=n; i++)
        {
                if (p[i-1].b > t)
                        t = p[i-1].b;
                if (t < p[i].a)
                        ans = false;
        }

        if (ans)
                printf("YES");
        else printf("NO");

        return 0;
}


#include <cstdio>
#include <algorithm>

using namespace std;

struct P
{
        int a,b;

        const bool operator < (const P& tmp)const{
                return this->a < tmp.a;
        }
}p[110];

int main()
{
        int n,m;
        scanf("%d%d",&n,&m);
        for (int i = 0; i<n; i++)
        scanf("%d%d",&p[i].a,&p[i].b);
        p[n].a = m;

        bool ans = true;
        int t = 0
        for (int i = 1; i<=n; i++)
        {
                if (p[i-1].b > t)
                        t = p[i-1].b;
                if (t < p[i].a)
                        ans = false;
        }

        if (ans)
                printf("YES");
        else printf("NO");

        return 0;
}
~


#include <cstdio>
#include <algorithm>

using namespace std;

struct P
{
        int a,b;

        const bool operator < (const P& tmp)const{
                return this->a < tmp.a;
        }
}p[110];

int main()
{
        int n,m;
        scanf("%d%d",&n,&m);
        for (int i = 0; i<n; i++)
        scanf("%d%d",&p[i].a,&p[i].b);

        sort(p,p+n);

        bool ans = true;
        for (int i = 1; i<n; i++)
        {
                if (p[i-1].b<p[i].a)
                        ans = false;
        }

        if (ans)
                printf("YES");
        else printf("NO");

        return 0;
}


#include <cstdio>
#include <algorithm>

using namespace std;

struct P
{
        int a,b;

        const bool operator < (const P& tmp)const{
                return this->a < tmp.a;
        }
}p[110];

int main()
{
        int n,m;
        scanf("%d%d",&n,&m);
        for (int i = 0; i<n; i++)
                scanf("%d%d",&p[i].a,&p[i].b);

        sort(p,p+n);

        bool ans = true;
        int t = 0;
        for (int i = 1; i<n; i++)
        {
                if (p[i-1].b > t)
                        t = p[i-1].b;
                if (t<p[i].a)
                        ans = false;
        }

        if (ans)
                printf("YES");
        else printf("NO");

        return 0;
}


#include <cstdio>

bool flag[110];
int a[110],b[110];

int main()
{
        int n,m;
        scanf("%d%d",&n,&m);

        for (int i = 0; i<n; i++)
                scanf("%d%d",&a[i],&b[i]);
        a[n] = m;

        flag[0] = true;

        int c[1000];
        c[1] = 0;
        int head = 1,tail = 1;
        while (head<=tail)
        {
                for (int i = c[head]+1; a[i]<= b[c[head]] && i<=n; i++)
                        if (!flag[i])
                        {
                                //printf("!!! %d\n",i);
                                c[++tail] = i;
                                flag[i] = true;
                        }
                head ++;
        }

        if (flag[n])
                printf("YES");
        else printf("NO");

        return 0;
}


#include <iostream>
#include <climits>

using namespace std;

int main()
{
    int n, m, maxtel = 0, maxdes = 0, minstart = INT_MAX, tel[100][2];
    bool flag = true;
    cin >> n >> m;
    for(int i=0;i<n;i++) cin >> tel[i][0] >> tel[i][1];
    for(int i=0;i<n;i++) {
        maxdes = max(maxdes, tel[i][1]);
        minstart = min(minstart, tel[i][0]);
    }
        for(int i=0;i<n-1 && tel[i][1] < m;i++) {
        maxtel = max(maxtel, tel[i][1]);
        if(maxtel < tel[i+1][0]) flag = false;
    }
    if(flag && maxdes >= m && minstart == 0) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
}


#include <iostream>

using namespace std;

int main()
{
    int n, m, maxtel = 0, tel[100][2];
    bool flag = true;
    cin >> n >> m;
    for(int i=0;i<n;i++) cin >> tel[i][0] >> tel[i][1];
    for(int i=0;i<n-1 && tel[i][1] < m;i++) {
        maxtel = max(maxtel, tel[i][1]);
        if(maxtel < tel[i+1][0]) cout << tel[i+1][0] << endl, flag = false;
    }
    if(flag && tel[n-1][1] >= m) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
}


#include <iostream>

using namespace std;

int main()
{
    int n, m, maxtel = 0, maxdes = 0, tel[100][2];
    bool flag = true;
    cin >> n >> m;
    for(int i=0;i<n;i++) cin >> tel[i][0] >> tel[i][1];
    for(int i=0;i<n;i++) maxdes = max(maxdes, tel[i][1]);
    for(int i=0;i<n-1 && tel[i][1] < m;i++) {
        maxtel = max(maxtel, tel[i][1]);
        if(maxtel < tel[i+1][0]) flag = false;
    }
    if(flag && maxdes >= m) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
}


#include <iostream>

using namespace std;

int main()
{
    int n, m, cur = 0, tel[100][2];
    bool flag = true;
    cin >> n >> m;
    for(int i=0;i<n;i++) cin >> tel[i][0] >> tel[i][1];
    for(int i=0;i<n-1;i++) {
        if(tel[i][1] < tel[i+1][0]) flag = false;
    }
    if(flag && tel[n-1][1] >= m) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
}


#include <iostream>

using namespace std;

int main()
{
    int n, m, maxtel = 0, tel[100][2];
    bool flag = true;
    cin >> n >> m;
    for(int i=0;i<n;i++) cin >> tel[i][0] >> tel[i][1];
    for(int i=0;i<n-1 && tel[i][1] < m;i++) {
        maxtel = max(maxtel, tel[i][1]);
        if(maxtel < tel[i+1][0]) flag = false;
    }
    if(flag && tel[n-1][1] >= m) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
}


#include<iostream>
using namespace std;
int main()
{
    int arr[205],i,n,m,j,r=0;
    cin>>n>>m;
    for(i=0; i<n*2; i++)
    {
        cin>>arr[i];
    }
    for(i=1; i<n*2&&arr[i]!=m; i+=2)
    {
        if(arr[i]<arr[i+1]&&r<arr[i+1])
        {
            cout<<"NO"<<endl;
            return 0;
        }
        if(r<arr[i])
            r=arr[i];
    }
    if(arr[i]==m&&arr[0]==0)
        cout<<"YES"<<endl;
    else
        cout<<"NO"<<endl;
    return 0;
}


#include<iostream>
using namespace std;
int main()
{
    int arr[102],ar[102],i,n,m,j;
    cin>>n>>m;
    for(i=0; i<n*2; i++)
    {
        cin>>arr[i];
    }
    for(i=1; i<n*2&&arr[i]<m; i+=2)
    {
        if(arr[i]<arr[i+1])
        {
            cout<<"NO"<<endl;
            return 0;
        }
    }
    if(arr[i]==m)
        cout<<"YES"<<endl;
    else
        cout<<"NO"<<endl;
    return 0;
}


#include<iostream>
using namespace std;
int main()
{
    int arr[102],ar[102],i,j,n,m,x=0,t,y=0;
    cin>>n>>m;
    for(i=0; i<n; i++)
    {
        cin>>arr[i]>>ar[i];
    }
    for(j=0; j<n-1; j++)
    {
        if(ar[j]>=arr[j+1])
        {
            if(ar[j+1]==m)
            {
                cout<<"YES"<<endl;
                return 0;
            }
        }
        else
        {
            x=1;
            break;
        }
    }
    if(x==1)
        cout<<"NO"<<endl;
    else if(ar[j]!=m)
        cout<<"NO"<<endl;
}


#include<iostream>
using namespace std;
int main()
{
    int arr[101],ar[101],i,j,n,f=0,m,x=1;
    cin>>n>>m;
    for(i=0; i<n; i++)
    {
        cin>>arr[i]>>ar[i];
    }
    for(j=0; j<n-1; j++)
    {
        if(ar[j]<arr[j+1])
        {
            cout<<"NO"<<endl;
            f=1;
            break;
        }
    }
    if(f==0)
        cout<<"YES"<<endl;
}


#include<iostream>
using namespace std;
int main()
{
    int arr[101],ar[101],i,j,n,f=0,m,x=0;
    cin>>n>>m;
    for(i=0; i<n; i++)
    {
        cin>>arr[i]>>ar[i];
    }
    for(j=0; j<n; j++)
    {

        if(ar[j]>=arr[j+1]&&ar[j]==m||ar[j]>=arr[j+1]&&ar[j+1]==m)
        {
            cout<<"YES";
            f=1;
            break;
        }
        else if(ar[j]!=m)
        {
            x=1;
            break;
        }

    }
    if(f==0||x==1)
        cout<<"NO";
return 0;
}


#include<iostream>
using namespace std;
int main()
{
    int arr[205],i,n,m,j;
    cin>>n>>m;
    for(i=0; i<n*2; i++)
    {
        cin>>arr[i];
    }
    for(i=1; i<n*2&&arr[i]!=m; i+=2)
    {
        if(arr[i]<arr[i+1])
        {
            cout<<"NO"<<endl;
            return 0;
        }
    }
    if(arr[i]==m)
        cout<<"YES"<<endl;
    else
        cout<<"NO"<<endl;
    return 0;
}


#include<iostream>
using namespace std;
int main()
{
    int arr[205],i,n,m,j,r=0;
    cin>>n>>m;
    for(i=0; i<n*2; i++)
    {
        cin>>arr[i];
    }
    for(i=1; i<n*2&&arr[i]!=m; i+=2)
    {
        if(arr[i]<arr[i+1]&&r<arr[i+1])
        {
            cout<<"NO"<<endl;
            return 0;
        }
        if(r<arr[i])
            r=arr[i];
    }
    if(arr[i]==m)
        cout<<"YES"<<endl;
    else
        cout<<"NO"<<endl;
    return 0;
}


#include<iostream>
using namespace std;
int main()
{
    int arr[101],ar[101],i,j,n,f=0,m;
    cin>>n>>m;
    for(i=0; i<n; i++)
    {
        cin>>arr[i]>>ar[i];
    }
    for(j=0; j<n; j++)
    {

        if(ar[j]>=arr[j+1]&&ar[j+1]==m&&ar[j]<arr[j+1])
        {
            cout<<"YES";
            f=1;
            break;
        }
    }
    if(f==0)
        cout<<"NO";
return 0;
}


#include<iostream>
using namespace std;
int main()
{
    int arr[102],ar[102],i,j,n,f=0,m,x=1;
    cin>>n>>m;
    for(i=0; i<n; i++)
    {
        cin>>arr[i]>>ar[i];
    }
        for(j=0; j<n-1; j++)
        {
            if(arr[0]!=0)
            {
                cout<<"NO"<<endl;
                return 0;
            }
            if(ar[j]<arr[j+1])
            {
                cout<<"NO"<<endl;
                f=1;
                break;
            }
        }
        if(f==0&&ar[j]==m)
            cout<<"YES"<<endl;
    return 0;
}


#include<iostream>
using namespace std;
int main()
{
    int arr[101],ar[101],i,j,n,f=0,m;
    cin>>n>>m;
    for(i=0; i<n; i++)
    {
        cin>>arr[i]>>ar[i];
    }
    for(j=0; j<n; j++)
    {

        if(ar[j]>=arr[j+1]&&ar[j+1]==m)
        {
            cout<<"YES";
            f=1;
            break;
        }
    }
    if(f==0)
        cout<<"NO";
}


#include<iostream>
using namespace std;
int main()
{
    int arr[205],i,n,m,j;
    cin>>n>>m;
    for(i=0; i<n*2; i++)
    {
        cin>>arr[i];
    }
    for(i=1; i<n*2&&arr[i]<m; i+=2)
    {
        if(arr[i]<arr[i+1])
        {
            cout<<"NO"<<endl;
            return 0;
        }
    }
    if(arr[i]==m)
        cout<<"YES"<<endl;
    else
        cout<<"NO"<<endl;
    return 0;
}


#include<iostream>
using namespace std;
int main()
{
    int arr[205],i,n,m,j,r=0;
    cin>>n>>m;
    for(i=0; i<n*2; i++)
    {
        cin>>arr[i];
    }
    cout<<r<<endl;
    for(i=1; i<n*2&&arr[i]!=m; i+=2)
    {
        if(arr[i]<arr[i+1]&&r<arr[i+1])
        {
            cout<<"NO"<<endl;
            return 0;
        }
        if(r<arr[i])
            r=arr[i];
    }
    if(arr[i]==m)
        cout<<"YES"<<endl;
    else
        cout<<"NO"<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,m,i,j,k,v1,v2,v3,x,y,z,a[1000],b[1000];
  cin>>n>>m;
  for(i=0;i<n;i++)
  cin>>a[i]>>b[i];
 if(a[0]!=0)
 {
     cout<<"NO";
     return 0;
 }
 x=b[0];
 for(i=0;i<n;i++)
 {

     if(x>=m)
     {
         cout<<"YES";
         return 0;
     }
     int mx=0;
     for(j=i+1;j<n;j++)
     {
         if(a[j]<=x)
            mx=max(mx,b[j]);
     }
     if(mx==0)
     {
         cout<<"NO";
         return 0;
     }
     x=mx;
 }
  cout<<"NO";

    return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,m,i,j,k,v1,v2,v3,x,y,z,a[1000],b[1000];
  cin>>n>>m;
  for(i=0;i<n;i++)
  cin>>a[i]>>b[i];

  if(a[0]!=0)
      {
          cout<<"NO";
          return 0;
      }

  if(b[0]>=m)
  {
      cout<<"YES";
      return 0;
  }
  for(i=1;i<n;i++)
  {
      if(a[i]>b[i-1])
      {
          cout<<"NO";
          return 0;
      }
    if(b[i]>=m)
  {
      cout<<"YES";
      return 0;
  }
  }
  if(n==1&&b[0]<m)
  {
      cout<<"NO";
      return 0;
  }
  cout<<"YES";

    return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,m,i,j,k,v1,v2,v3,x,y,z,a[1000],b[1000];
  cin>>n>>m;
  for(i=0;i<n;i++)
  cin>>a[i]>>b[i];

  if(b[n-1]<m||a[0]!=0)
      {
          cout<<"NO";
          return 0;
      }

  if(b[0]>=m)
  {
      cout<<"YES";
      return 0;
  }
  for(i=1;i<n;i++)
  {
      if(a[i]>b[i-1])
      {
          cout<<"NO";
          return 0;
      }
    if(b[i]>=m)
  {
      cout<<"YES";
      return 0;
  }
  }
  cout<<"YES";

    return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,m,i,j,k,v1,v2,v3,x,y,z,a[1000],b[1000];
  cin>>n>>m;
  for(i=0;i<n;i++)
  cin>>a[i]>>b[i];

  if(b[n-1]<m)
      {
          cout<<"NO";
          return 0;
      }

  for(i=1;i<n;i++)
  {
      if(a[i]>b[i-1])
      {
          cout<<"NO";
          return 0;
      }
  }
  cout<<"YES";

    return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,m,i,j,k,v1,v2,v3,x,y,z,a[1000],b[1000];
  cin>>n>>m;
  for(i=0;i<n;i++)
  cin>>a[i]>>b[i];

  if(b[n-1]<m||a[0]!=0)
      {
          cout<<"NO";
          return 0;
      }

  for(i=1;i<n;i++)
  {
      if(a[i]>b[i-1])
      {
          cout<<"NO";
          return 0;
      }
  }
  cout<<"YES";

    return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,m,i,j,k,v1,v2,v3,x,y,z,a[1000],b[1000];
  cin>>n>>m;
  for(i=0;i<n;i++)
  cin>>a[i]>>b[i];

  if(a[0]!=0)
      {
          cout<<"NO";
          return 0;
      }

  if(b[0]>=m)
  {
      cout<<"YES";
      return 0;
  }
  for(i=1;i<n;i++)
  {
      if(a[i]>b[i-1])
      {
          cout<<"NO";
          return 0;
      }
    if(b[i]>=m)
  {
      cout<<"YES";
      return 0;
  }
  }
  cout<<"YES";

    return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,m,i,j,k,v1,v2,v3,x,y,z,a[1000],b[1000];
  cin>>n>>m;
  for(i=0;i<n;i++)
  cin>>a[i]>>b[i];

  if(b[n-1]<m||a[0]!=0)
      {
          cout<<"NO";
          return 0;
      }

  if(b[0]>=m)
  {
      cout<<"YES";
      return 0;
  }
  for(i=1;i<n;i++)
  {
      if(b[i]>=m)
  {
      cout<<"YES";
      return 0;
  }
      if(a[i]>b[i-1])
      {
          cout<<"NO";
          return 0;
      }
  }
  cout<<"YES";

    return 0;

}


#include<iostream>
#include<string>
using namespace std;
int main()
{
  int n,m,x[101],y[101],ma=0;
  cin>>n>>m;
  for(int i=0;i<n;i++)
  {
      cin>>x[i]>>y[i];

  }
  if(x[0]!=0)
  {
      cout<<"No";
      return 0;
  }
  for(int i=0;i<n;i++)
  {
       ma=max(ma,y[i]);
   if(i!=n-1)
   {
    if(ma<x[i+1])
       {
              cout<<"NO";
              break;
         }
   }
  else
      {
        if(ma==m)
           cout<<"YES";
        else
           cout<<"NO";

      }
  }

    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int  n,m,tab[1000][2];
    cin>>n>>m;
    for(int i=0;i<n;i++)
    {
        cin>>tab[i][0]>>tab[i][1];
        }
        int j=0;

        while(tab[j][1]!=m &&  (j<n-1 && tab[j+1][0]<=tab[j][1]))
        {
              j++;}

        if( tab[j][1]==m|| tab[j+1][1]==m)
           cout<<"YES";
            else
                cout<<"NO";

    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int  n,m,tab[1000][2];
    cin>>n>>m;
    for(int i=0;i<n;i++)
    {
        cin>>tab[i][0]>>tab[i][1];
        }
        int j=0;

        while((tab[j][1]!=m  && tab[j+1][0]<=tab[j][1])&& j<n-1)
        {
              j++;}

        if( tab[j][1]==m && j<=n-1)
           cout<<"YES";
            else
                cout<<"NO";

    return 0;
}


gets
a=gets.split.map &:to_i
puts(a.count(m=a.min)>1?"Still Rozdil":1+a.index(m))


n = gets.to_i
a = gets.split.map(&:to_i)
m = a.min
f = (0...n).find_all{|x| a[x]==m}
if f.size == 1
  puts f[0] + 1
else
  puts "Still Rozdil"
end


n = gets.to_i
a = gets.split.map(&:to_i)
f = (0...n).find_all{|x| a[x]==a.min}
if f.size == 1
  puts f[0] + 1
else
  puts "Still Rozdil"
end


n = gets.to_i
a = gets.split.map(&:to_i)
if a.count(a.min)>1
  puts "Still Rozdil"
else
  puts a.index(a.min)+1
end


gets
a = gets.split.map { |i| i.to_i }
puts a.count(a.min) == 1 ? a.index(a.min) + 1 : "Still Rozdil"


gets
a=gets.split.map &:to_i
m=a.min
puts a.count(m)>1 ? "Still Rozdil" : a.index(m)+1


n=input()
a=[int(x) for x in raw_input().split()]
if n==1:
    print 1
else:
    j=min(a)
    if a.count(j)>1:
        print "Still Rozdil"
    else:
        print a.index(j)


n=input()
a=[int(x) for x in raw_input().split()]
if n==1:
    print 1
else:
    j=min(a)
    if a.count(j)>1:
        print "Still Rozdil"
    else:
        print a.index(j)+1


n = int(raw_input())
l = raw_input().split(' ')
l = map(int,l)
if l.count(min(l)) > 1:
	print 'Still Rozdil'
else:
	print l.index(min(l))+1


t, times = input(), map(int, raw_input().split())
candidate = min(times)
if times.count(candidate) == 1:
	print times.index(candidate) + 1
else:
	print "Still Rozdil"


t, times = input(), map(int, raw_input().split())
candidate = min(times)
if times.count(candidate) == 1:
	print candidate
else:
	print "Still Rozdil"


raw_input(); x = map(int, raw_input().split())
print "Still Rozdil" if x.count(min(x)) > 1 else x.index(min(x)) + 1


read = raw_input
readints = lambda: map(int, read().split())

def find(f, seq):
  for item in range(len(seq)):
    if seq[item] == f:
      return item

n, = readints()
m = readints()

mn = min(m)

print (find(mn, m) + 1) if m.count(mn) == 1 else "Still Rozdil"


n = int(raw_input())
k = raw_input()
k = k.split()

i = 0
while (i < n):
	k[i] = int(k[i])
	i += 1

mini = k[0]
ans = '1'

i = 1
while (i < n) and (ans != 'Still Rozdil'):
	if (mini > k[i]):
		mini = k[i]
		ans = str(i+1)
	elif (mini == k[i]):
		ans = 'Still Rozdil'
	i += 1

print ans


n = int(raw_input())
k = raw_input()
k = k.split()

i = 0
while (i < n):
	k[i] = int(k[i])
	i += 1

mini = k[0]
ans = 1
arr = []
arr.append(ans)

i = 1
while (i < n):
	if (mini > k[i]):
		arr = []
		mini = k[i]
		ans = i+1
		arr.append(ans)
	elif (mini == k[i]):
		arr.append(i+1)
	i += 1

if (len(arr) > 1):
	print 'Still Rozdil'
else:
	print ans


n = int(raw_input())
k = raw_input()
k = k.split()

i = 0
while (i < n):
	k[i] = int(k[i])
	i += 1

mini = k[0]
ans = 1
arr = []

i = 1
while (i < n):
	if (mini > k[i]):
		arr = []
		mini = k[i]
		ans = i+1
		arr.append(ans)
	elif (mini == k[i]):
		arr.append(i+1)
	i += 1

if (len(arr) > 1):
	print 'Still Rozdil'
else:
	print ans


n = input()

ls = map(int,raw_input().split())

k = min(ls)

if ls.count(k)>1:
    print('Still Rozdil')
else:
    print(ls.index(k)+1)


n = int(raw_input())
l = map(int, raw_input().split())
a = 99999999999
b = 99999999999
x = 0
ok = True
for i in xrange(len(l)):
    if l[i] < a:
        a = l[i]
        x = i+1
        ok = True
    elif l[i] == a:
        ok = False

print x if ok else "Still Rozdil"


n = int(raw_input())
l = map(int, raw_input().split())
a_i = 0
b_i = 0
a = 99999999999
b = 99999999999
for i in xrange(len(l)):
    if l[i] <= a:
        b = a
        a = l[i]
        b_i = a_i
        a_i = i+1
    else:
        if b > l[i]:
            b = l[i]
            b_i = i+1
print a_i if a != b else "Still Rozdil"


print [r.count(min(r)) > 1 and 'Still Rozdil' or r.index(min(r))+1 for n,r in [(int(raw_input()),[int(c) for c in raw_input().split()])]][0]


n = input()
a = list(map(int, raw_input().split()))
if a.count(min(a)) > 1:
      print 'Still Rozdil'
else:
      print a.index(min(a)) + 1


n = input()
a = list(map(int, raw_input().split()))
if a.count(min(a)) > 1:
      print 'Still Rozdil'
else
      print a.find(min(a)) + 1


n=input()
a=map(int, raw_input().split())
print 'Still Rozdil' if a.count(min(a)) > 1 else a.index(min(a))+1


n = input()
a = [int(x) for x in raw_input().split()]
if(a.count(min(a))==1):
	print a.index(min(a))+1
else:
	print "Still Rozdil"


n = int(raw_input())
distance = map(int, raw_input().split())

res = -1

for i,v in enumerate(distance):
	if (res == -1) or (v < distance[res]):
		unique = True
		res = i
	elif (distance[res] == v):
		unique = False

if res == -1 or not unique:
	res = "Still Rozdil"
else:
	res=res+1
print res


import sys

def main():
    n = int(raw_input())
    s = raw_input()
    l = s.split()
    li = [ int(s) for s in l ]
    minimo = 1000000000
    ind = None
    i = 1
    for el in li:
        if el < minimo:
            minimo = el
            cont = 1
            ind = i
        elif el == minimo:
            cont += 1
        i += 1
    if cont == 1: print ind
    else: print "Still Rozdil"

if __name__ == '__main__':
    main()


import sys

def main():
    n = int(raw_input())
    s = raw_input()
    l = s.split()
    li = [ int(s) for s in l ]
    minimo = 10000000000
    ind = None
    i = 1
    for el in li:
        if el < minimo:
            minimo = el
            cont = 1
            ind = i
        elif el == minimo:
            cont += 1
        i += 1
    if cont == 1: print ind
    else: print "Still Rozdil"

if __name__ == '__main__':
    main()


N=input()
A=map(int,raw_input().split())
k=min(A); p = 0; c = 0
for i in xrange(N):
    if A[i] == k:
        p = i+1; c += 1
print 'Still Rozdil' if c>1 else p


n = input()
a = map(int,raw_input().split())
b,c = min(a),a.count(min(a))
print [a.index(b)+1,"Still Rozdil"][c > 1]


n = input()
a = map(int,raw_input().split())
print "Still Rozdil" if a.count(min(a)) > 1 else a.index(min(a))+1


def main():
	n = input()
	xs = [int(i) for i in raw_input().split()]
	m = min(xs)
	if xs.count(m) == 1:
		print xs.index(m) + 1
	else:
		print 'Still Rozdil'

main()


n = input()
p = map(int, raw_input().strip().split())

if p.count(min(p)) == 1:
    print p.index(min(p))+1
else:
    print "Still Rozdil"


numberOfcities = raw_input()
cities = raw_input()
citiesTimeList = cities.split(" ")
minTime = 1000000000
minCityindex = 5555
for cityTime in citiesTimeList:
    if int(cityTime) < int(minTime) :
        minTime = int(cityTime)
        minCityindex = citiesTimeList.index(cityTime)
if citiesTimeList.count(str(minTime)) != 1:
    minCityindex = 5555
if minCityindex == 5555:
    print "Still Rozdil"
else:
    print int(minCityindex) + 1


numberOfcities = raw_input()
cities = raw_input()
citiesTimeList = cities.split(" ")
minTime = 10000000000
minCityindex = 5
for cityTime in citiesTimeList:
    if int(cityTime) < int(minTime) :
        minTime = int(cityTime)
        minCityindex = citiesTimeList.index(cityTime)
if citiesTimeList.count(str(minTime)) != 1:
    minCityindex = 5
if minCityindex == 5:
    print "Still Rozdil"
else:
    print int(minCityindex) + 1


numberOfcities = raw_input()
cities = raw_input()
citiesTimeList = cities.split(" ")
minTime = 1000000000
minCityindex = 555555555555555555555555
for cityTime in citiesTimeList:
    if int(cityTime) < int(minTime) :
        minTime = int(cityTime)
        minCityindex = citiesTimeList.index(cityTime)
if citiesTimeList.count(str(minTime)) != 1:
    minCityindex = 555555555555555555555555
if minCityindex == 555555555555555555555555:
    print "Still Rozdil"
else:
    print int(minCityindex) + 1


numberOfcities = raw_input()
cities = raw_input()
citiesTimeList = cities.split(" ")
minTime = 1000000000
minCityindex = 5555
for cityTime in citiesTimeList:
    if int(cityTime) < minTime and citiesTimeList.count(cityTime) == 1:
        minTime = cityTime
        minCity = citiesTimeList.index(cityTime)
    else:
        minCityindex = 5555
if minCity == 5555:
    print "Still Rozdil"
else:
    print int(minCity) + 1


numberOfcities = raw_input()
cities = raw_input()
citiesTimeList = cities.split(" ")
minTime = 100000000000000000000000000000000
minCityindex = 555555555555555555555555
for cityTime in citiesTimeList:
    if int(cityTime) < int(minTime) :
        minTime = int(cityTime)
        minCityindex = citiesTimeList.index(cityTime)
if citiesTimeList.count(str(minTime)) != 1:
    minCityindex = 555555555555555555555555
if minCityindex == 555555555555555555555555:
    print "Still Rozdil"
else:
    print int(minCityindex) + 1


numberOfcities = raw_input()
cities = raw_input()
citiesTimeList = cities.split(" ")
minTime = 1000000000
minCityindex = 5555
for cityTime in citiesTimeList:
    if int(cityTime) < int(minTime) :
        minTime = int(cityTime)
        minCity = citiesTimeList.index(cityTime)
if citiesTimeList.count(str(minTime)) != 1:
    minCity = 5555
if minCity == 5555:
    print "Still Rozdil"
else:
    print int(minCity) + 1


numberOfcities = raw_input()
cities = raw_input()
citiesTimeList = cities.split(" ")
minTime = 1000000000
minCityindex = 5555
for cityTime in citiesTimeList:
    if int(cityTime) < minTime :
        minTime = cityTime
        minCity = citiesTimeList.index(cityTime)
if citiesTimeList.count(minTime) != 1:
    minCity = 5555
if minCity == 5555:
    print "Still Rozdil"
else:
    print int(minCity) + 1


__author__ = 'avm'

from sys import stdin

null = stdin.readline()

still=0
digit=''
minimum=int(1000000001)
index=0
min_index=-1

char = stdin.read(1)

while char != "\n":
    if char != " ":
        digit+=char
    else:
       index+=1
       d = int (digit)
       digit=''
       if minimum > d:
           minimum = d
           min_index=index
       elif minimum == d:
            still = d
    char = stdin.read(1)

index+=1
d = int (digit)
if minimum > d:
   minimum = d
   min_index=index
elif minimum == d:
   still = d

if minimum == still:
    print "Still Rozdil"
else:
    print "%d" % min_index


__author__ = 'avm'

from sys import stdin

null = stdin.readline()

still=0
digit=''
minimum=int(1000000000)
index=0
min_index=-1

char = stdin.read(1)

while char != "\n":
    if char != " ":
        digit+=char
    else:
       index+=1
       d = int (digit)
       digit=''
       if minimum > d:
           minimum = d
           min_index=index
       elif minimum == d:
            still = d
    char = stdin.read(1)

index+=1
d = int (digit)
if minimum > d:
   minimum = d
   min_index=index
elif minimum == d:
   still = d

if minimum == still:
    print "Still Rozdil"
else:
    print "%d" % min_index


n = int(raw_input())
l = map(int, raw_input().split())
x = min(l)
flag = 0
seen = 0
for i in xrange(n):
	if l[i] == x and seen == 1:
		flag = 1
		break
	elif l[i] == x and seen == 0 and flag == 0:
		seen = 1
		answer = i + 1
		flag

if flag:
	print "Still Rozdil"
else:
	print answer


n = int(raw_input())
l = map(int, raw_input().split())
x = set(l)
if len(x) == n:
	print l.index(min(x)) + 1
else:
	print "Still Rozdil"


n = int(raw_input())
l = map(int, raw_input().split())
x = set(l)
if len(x) != len(l):
	print "Still Rozdil"
else:
	print l.index(min(x)) + 1


n = int( raw_input() )
lst = map( int, raw_input().split() )

a = lst[:]
lst.sort()

if n == 1:
    print 1
else:
    if lst[0] == lst[1]:
        print 'Still Rozdil'
    else:
        print a.index(min(a)) + 1


n= int(input())
arr=map(int,raw_input().split())
x= min(arr)
if arr.count(x)>1:
  print "Still Rozdil"
else:
  print arr.index(x)+1


n= int(input())
arr=map(int,raw_input().split())
if len(arr)<>len(list(set(arr))):
  print "Still Rozdil"
else:
  print arr.index(min(arr))+1


n= int(input())
arr=map(int,raw_input().split())
if len(arr)<>len(list(set(arr))):
  print "Still Rozdil"
else:
  print min(arr)


n = int(raw_input())

parts = [int(x) for x in raw_input().split()]

lis = []

index  = 0

for p in parts:
  lis.append((index, p))
  index += 1

lis.sort(key = lambda x: x[1])

if len(parts) == 1:
  print 1
else:
  if lis[0][1] == lis[1][1]:
    print "Still Rozdil"
  else:
    print lis[0][0] + 1


n = input()
A = [int(x) for x in raw_input().split()]
g = min(A)
if len([x for x in A if x==g])>1:
    print 'Still Rozdil'
else:
    for i in range(n):
        if A[i] == g:
            print i+1
            break


n = input()
A = [int(x) for x in raw_input().split()]
g = min(A)
if len([x for x in A if x==g])>1:
    print 'Still Rozdil'
else:
    print A.index(g)+1


import sys
import collections
is_first = False
for line in sys.stdin:
    if not is_first:
        is_first = True
        continue
    arr = [int(t) for t in line.split()]
    d = collections.defaultdict(list)
    for i, v in enumerate(arr):
        d[v].append(i)
    t = sorted(list(d.keys()))[0]
    if len(d[t]) > 1:
        print "Still Rozdil"
    else:
        print d[t][0]


import sys
import collections
is_first = False
for line in sys.stdin:
    if not is_first:
        is_first = True
        continue
    arr = [int(t) for t in line.split()]
    d = collections.defaultdict(list)
    for i, v in enumerate(arr):
        d[v].append(i)
    t = sorted(list(d.keys()))[0]
    if len(d[t]) > 1:
        print "Still Rozdil"
    else:
        print d[t][0] + 1


raw_input()
a = [int(st) for st in raw_input().split(' ')]
b = sorted(a)
if b[0] == b[1]:
    print ("Still Rozdil")
else:
    print(a.index(min(a))+1)


raw_input()
a = [int(st) for st in raw_input().split(' ')]
if len(a) == 1:
    print(1)
else:
    b = sorted(a)
    if b[0] == b[1]:
        print ("Still Rozdil")
    else:
        print(a.index(min(a))+1)


raw_input()
a = [int(st) for st in raw_input().split(' ')]
if sorted(a)[0] == sorted(a)[1]:
    print "Still Rozdil"
else:
    print(a.index(min(a))+1)


raw_input()
a = [int(st) for st in raw_input().split(' ')]
if len(a) == 1:
    print(a[0])
else:
    b = sorted(a)
    if b[0] == b[1]:
        print ("Still Rozdil")
    else:
        print(a.index(min(a))+1)


#!/usr/bin/env python

def count():
    n = int(raw_input())
    min = 100000000000
    count = 0
    mini = 0
    l = raw_input().split()
    for i in range(n):
        x = int(l[i])
        if x == min:
            count += 1
        elif x <min:
            min = x
            count = 1
            mini = i
    if count == 1:
        print mini+1
    else:
        print "Still Rozdil"

count()


#!/usr/bin/env python

def count():
    n = int(raw_input())
    l = raw_input().split()
    if n == 1:
        print l[0]
    else:
        l.sort
        if l[0] == l[1]:
            print "Still Rozdil"
        else:
            print l[0]
count()


# http://codeforces.com/problemset/problem/205/A#

n = input()
def int_line():
    return map(int,raw_input().split())

ctys = int_line()

if len(ctys) == len(set(ctys)):
    mn = min (ctys)
    print (ctys.index(mn) +1)
else:
   print ("Still Rozdil")


# http://codeforces.com/problemset/problem/205/A#

n = input()
def int_line():
    return map(int,raw_input().split())

my_max = 1000000001
ct = 0
idx = 0
ctys = int_line()
for i , val in enumerate(ctys):
    if val < my_max:
        my_max = val
        idx = i
        ct = 1
    elif val == my_max:
        ct = ct + 1

if ct > 1:
    print ('Still Rozdil')
    quit()
else:
    print (idx+1)


# http://codeforces.com/problemset/problem/205/A#

n = input()
def int_line():
    return map(int,raw_input().split())

my_max = 1000000001
ct = 0
idx = 1
ctys = int_line()
for i , val in enumerate(ctys):
    if val < my_max:
        my_max = val
        ct = 1
    elif val == my_max:
        ct = ct + 1

if ct > 1:
    print ('Still Rozdil')
    quit()
else:
    print (i+1)


# http://codeforces.com/problemset/problem/205/A#

n = input()
def int_line():
    return map(int,raw_input().split())

my_max = 1000000001
ct = 0
idx = 1
ctys = int_line()
for i , val in enumerate(ctys):
    if val < my_max:
        my_max = val
        ct = 1
    elif val == my_max:
        ct = ct + 1
        if ct> 1:
            print ('Still Rozdil')
            quit()

print (i+1)


# http://codeforces.com/problemset/problem/205/A#

n = input()
def int_line():
    return map(str,raw_input().split())

ctys = int_line()

if len(ctys) == len(set(ctys)):
    mn = min (ctys)
    print (ctys.index(mn) +1)
else:
   print ("Still Rozdil")


n = input()
t = [int(x) for x in raw_input().split(" ")]
mn = min(t)
if t.count(mn)>1:
	print "Still Rozdil"
else:
	print t.index(mn)+1


n = input()
t = [int(x) for x in raw_input().split(" ")]
mn = min(t)
if t.count(mn)>1:
	print "Still Rozdil"
else:
	print t.index(mn)


raw = map(int, raw_input().split())
n = raw[0]
raw = map(int, raw_input().split())
a = raw
mi = min(a)
k = a.count(mi)
if k == 1 :
  ans =  a.index(k)
  print ans + 1
else :
  print "Still Rozdil"


raw = map(int, raw_input().split())
n = raw[0]
raw = map(int, raw_input().split())
a = raw[:]
mi = min(a)
k = a.count(mi)
if k == 1 :
  ans =  a.index(mi)
  print ans + 1
else :
  print "Still Rozdil"


raw = map(int, raw_input().split())
n = raw[0]
a = raw[1:]
mi = min(a)
k = a.count(mi)
if k == 1 :
  ans =  a.index(k)
  print ans + 1
else :
  print "Still Rozdil"


n = int(raw_input())
dists = map(int,raw_input().split())
distancia = 10**9
count = 0
for e in range(n):
	if dists[e] < distancia:
		count = 0
		index = e
		distancia = dists[e]
		count += 1
	elif dists[e] == distancia:
		count += 1

if count != 1:
	print 'Still Rozdil'
else:
	print index+1


n = int(raw_input())
dists = map(int,raw_input().split())
valores = [-1]*(10**5)

dist = dists[0]
flag1 = False
for e in range(n):

	valores[e] = dists[e]

for e in valores[1:]:
	if e == dist and e != -1:
		flag1 = True

	if e < dist and e != -1:
		flag1 = False
		dist = e

if flag1 :
	print 'Still Rozdil'
else:
	print dist


n = int(raw_input())
dists = map(int,raw_input().split())
valores = [-1]*(10**5)

dist = 0
flag1 = False
for e in range(n):

	valores[e] = dists[e]

for e in range(1,10**5):
	if valores[e] == valores[dist] and valores[e] != -1:
		flag1 = True

	if valores[e] < valores[dist] and valores[e] != -1:
		flag1 = False
		dist = e

if flag1 :
	print 'Still Rozdil'
else:
	print dist+1


n = int(raw_input())
dists = map(int,raw_input().split())
distancia = 10**9
for e in range(n):
	if dists[e] < distancia:
		count = 0
		index = e
		distancia = dists[e]
		count += 1
	elif dists[e] == distancia:
		count += 1

if count != 1:
	print 'Still Rozdil'
else:
	print index+1


n = int(raw_input())
t = list(map(int,raw_input().split()))
if len(t) == 1:
	print 1
	exit(0)
m = min(t)
ind = t.index(m)
t.pop(ind)
if min(t) == m:
	print 'Still Rozdil'
else:
	print ind + 1


n = int(raw_input())
t = list(map(int,raw_input().split()))
tt = sorted(t)
if len(t) == 1:
	print 1
if tt[0] == tt[1]:
	print 'Still Rozdil'
else:
	print t.index(tt[0]) + 1


n = int(raw_input())
t = list(map(int,raw_input().split()))
tt = sorted(t)
if tt[0] == tt[1]:
	print 'Still Rozdil'
else:
	print t.index(tt[0]) + 1


import sys
import copy

f = open('in.txt','r')
#f = sys.stdin

def main():
	n = int(f.readline().strip());
	v = map(int , f.readline().strip().split())
	t = min(v)
	c = v.count(t)
	if (c>1):
		print 'Still Rozdil'
	else:
		for i in xrange(0,len(v)):
			if (v[i]==t):
				print i+1

if __name__ == "__main__":
	main()


import sys
import copy

#f = open('in.txt','r')
f = sys.stdin

def main():
	n = int(f.readline().strip());
	v = map(int , f.readline().strip().split())
	t = min(v)
	c = v.count(t)
	if (c>1):
		print 'Still Rozdil'
	else:
		for i in xrange(0,len(v)):
			if (v[i]==t):
				print i+1

if __name__ == "__main__":
	main()


#!/usr/bin
raw_input()
s = map(int, raw_input().split())
r = min(s)
k = s.index(r)+1
try:
    k = 1 + s[k:].index(r)
except ValueError:
    print k
else:
    print "Still Rozdil"


import sys

n = sys.stdin.readline()

mx = 1000000001
pos = 0
k = 0
duplicate = True

for x in sys.stdin.readline().strip().split():
    dist = int(x)
    k += 1
    if dist < mx:
        mx = dist
        pos = k
        duplicate = False
    elif dist == mx:
        duplicate = True

if duplicate:
    print('Still Rozdil')
else:
    print(pos)


import sys,math

n=int(sys.stdin.readline().strip())
i=[int(x) for x in sys.stdin.readline().split()]
j=i[:]
j.sort()

if j.count(j[0])>1:
    print 'Still Rozdil'
else:
    print i.index(j[0])+1


raw_input()
strlist = raw_input().split()
intlist = map((lambda x : long(x)), strlist)

index  = 0
minvar = long(1e9)
for i in xrange(len(intlist)):
    if intlist[i] < minvar:
        index  = i
        minvar = intlist[i]

if intlist.count(minvar) != 1:
    print 'Still Rozdil'
else:
    print index+1


n = input()
l = map(int,raw_input().split())
k =[]
for i in range(n):
    k.append([l[i],i])

k.sort()
# print k
if n!=1:
    if k[0][0]==k[1][0]:
        print "Still Rozdil"
    else:
        print k[0][1]+1
else:
    print 1


from collections import Counter
n = int(raw_input())
lst = map(int, raw_input().split())
mn = min(lst)
print "Still Rozdil" if lst.count(mn)>1 else lst.index(mn)+1


input()
s=map(int,raw_input().split())
m=min(s)
print "Still Rozdil" if s.count(m) > 1 else s.index(m)+1


n=int(raw_input())
l=map(int,raw_input().split())
m=min(l)
print l.index(m)+1 if l.count(m)==1 else 'Still Rozdil'


import os
import random
import math
import sys

def main():
	n=int(raw_input())
	ar=map(long,raw_input().split(" "))
	mint=min(ar)
	minind=ar.index(mint)
	city=minind+1
	countmin=ar.count(mint)
	if countmin>1:
		print "Still Rozdil"
	else:
		print city
main()


# -*- coding:utf-8 -*-
#[n, m] = [int(x) for x in raw_input().split()]

def some_func():
    """
    """
    n = input()
    n_list = [int(x) for x in raw_input().split()]
    temp=10000000000
    flag =1
    flag_i = -1
    for i in range(n):
        if n_list[i] == temp:
            flag = 0
        elif n_list[i] < temp:
            temp = n_list[i]
            flag=1
            flag_i=i
    if flag:
        return flag_i+1
    else:
        return "Still Rozdil"

if __name__ == '__main__':
    print some_func()


n = int(raw_input());
mn = 1000000009;
ok = False;
ans = -1;

str = raw_input();
str = str.split(' ');

for i in range(0, n):
	tp = int(str[i]);
	if tp == mn:
		ok = True;
	if tp < mn:
		ans = i+1;
		ok = False;
		mn = tp;
if ok:
	print 'Still Rozdil';
else:
	print ans;


N=int(raw_input())
Seq=map(int,raw_input().split())
M=min(Seq)
if Seq.count(M)>1:
    print'Still Rozdil'
else:
    print Seq.index(M)+1


input()
t = map(int, raw_input().split())
m = min(t)
print ['Still Rozdil', t.index(m) + 1][t.count(m) == 1]


#include<stdio.h>
#include<math.h>
int main(){
	int t1,t,a,b,c,d,e,f;
	scanf("%d",&t1);
	t=t1+1;
	while(t=t-1){
		scanf("%d %d %d %d",&a,&b,&c,&d);
		if(a==c){
			e=fabs(b-d);
			printf("%d\n",e);
		}
		else if(b==d){
			f=fabs(a-c);
			printf("%d\n",f);
		}
		else{
			e=fabs(b-d);
			f=fabs(a-c);
			printf("%d\n",e+f+2);
		}
	}
	return 0;

}


#include<stdio.h>
int main(){
	int i,t;
	float x1,x2,y1,y2,hieu,time;
	scanf("%d",&t);
	for(i=0;i<t;i++){
		scanf("%f %f %f %f",&x1,&y1,&x2,&y2);
		if(x1==x2){
			hieu=y1-y2;
			if(hieu<0) hieu=0-hieu;
			printf("%.f\n",hieu);
		}
		else{
			hieu=x1-x2;
			if(hieu<0) hieu=0-hieu;
			if(y1==y2) printf("%.f\n",hieu);
			else{
				time=hieu+2;
				hieu=y1-y2;
				if(hieu<0) hieu=0-hieu;
				time+=hieu;
				printf("%.f\n",time);
			}
		}
	}
}


#include<stdio.h>
int main(){
	int i,t;
	float x1,x2,y1,y2,hieu,time;
	scanf("%d",&t);
	for(i=0;i<t;i++){
		scanf("%f %f %f %f",&x1,&y1,&x2,&y2);
//x truc tung, y truc hoanh
//di ngang truoc doc sau
		if(x1==x2){
			hieu=y1-y2;
			if(hieu<0) hieu=0-hieu;
			printf("%.f\n",hieu);
		}
		else{
			hieu=x1-x2;
			if(hieu<0) hieu=0-hieu;
			if(y1==y2) printf("%.f\n",hieu);
			else{
				time=hieu+2;
				hieu=y1-y2;
				if(hieu<0) hieu=0-hieu;
				time+=hieu;
				printf("%.f\n",time);
			}
		}
	}
}


#include<stdio.h>
int main(){
	int i,t;
	long long x1,x2,y1,y2,hieu,time;
	scanf("%d",&t);
	for(i=0;i<t;i++){
		scanf("%lld %lld %lld %lld",&x1,&y1,&x2,&y2);
		if(x1==x2){
			hieu=y1-y2;
			if(hieu<0) hieu=0-hieu;
			printf("%lld\n",hieu);
		}
		else{
			hieu=x1-x2;
			if(hieu<0) hieu=0-hieu;
			if(y1==y2) printf("%lld\n",hieu);
			else{
				time=hieu+2;
				hieu=y1-y2;
				if(hieu<0) hieu=0-hieu;
				time+=hieu;
				printf("%.lld\n",time);
			}
		}
	}
}


#include <iostream>

using namespace std;

int main(){
    int q;
    cin>>q;
    for(int i=0;i<q;i++){
    int x1,y1,x2,y2;
    cin>>x1>>y1>>x2>>y2;
    if((x2-x1==0)||(y2-y1==0))
         cout<<abs(x2-x1)+abs(y2-y1);
    else cout<<abs(x2-x1)+abs(y2-y1)+2;
    cout<<"\n";
    }
}


#include <iostream>

using namespace std;

int main(){
    int q;
    cin>>q;
    for(int i=0;i<q;i++){
    int x1,y1,x2,y2;
    cin>>x1>>y1>>x2>>y2;
    if((x2-x1==0)||(y2-y1==0))
         cout<<abs(x2-x1)+abs(y2-y1);
    else cout<<abs(x2-x1)+abs(y2-y1)+2;
    }
}


#include <iostream>

using namespace std;

int main(){
    int q;
    cin>>q;
    for(int i=0;i<q;i++){
    int x1,y1,x2,y2;
    cin>>x1>>y1>>x2>>y2;
    if((x2-x1==0)||(y2-y1==0))
         cout<<abs(x2-x1)+abs(y2-y1);
    else cout<<abs(x2-x1)+abs(y2-y1)+2;
    cout<<"\n"
    }
}


#include <bits/stdc++.h>

using namespace std;

int main(){
    int x1,y1,x2,y2;
    cin>>x1>>y1>>x2>>y2;
    if((x2-x1==0)||(y2-y1==0))
         return abs(x2-x1)+abs(y2-y1);
    else return abs(x2-x1)+abs(y2-y1)+2;
}


#include <iostream>
#include <math.h>

using namespace std;

long long GetTime(long long, long long, long long, long long);

int main()
{
	int n;
	cin >> n;

	long long* times = new long long[n];

	for (int i = 0; i < n; i++)
	{
		long long x1, y1, x2, y2;
		cin >> x1 >> y1 >> x2 >> y2;

		long long time = GetTime(x1, y1, x2, y2);
		times[i] = time;
	}

	for (int i = 0; i < n; i++)
	{
		cout << times[i] << endl;
	}
}

long long GetTime(long long x1, long long y1, long long x2, long long y2)
{
	long long dx = abs(x2 - x1);
	long long dy = abs(y2 - y1);

	if (x1 == x2) return dy;
	else if (y1 == y2) return dx;
	else if (dx == dy) return 4 * dx;
	else return abs(dx - dy) + 4 * dx;
}


#include <iostream>
#include <math.h>

using namespace std;

long long GetTime(long long, long long, long long, long long);

int main()
{
	int n;
	cin >> n;

	long long* times = new long long[n];

	for (int i = 0; i < n; i++)
	{
		long long x1, y1, x2, y2;
		cin >> x1 >> y1 >> x2 >> y2;

		long long time = GetTime(x1, y1, x2, y2);
		times[i] = time;
	}

	for (int i = 0; i < n; i++)
	{
		cout << times[i] << endl;
	}
}

long long GetTime(long long x1, long long y1, long long x2, long long y2)
{
	long long dx = abs(x2 - x1);
	long long dy = abs(y2 - y1);

	if (x1 == x2) return dy;
	else if (y1 == y2) return dx;
	else if (dx == dy) return 2 * dx + 2;
	else if (dx > dy) return abs(dx - dy) + 2 * dy + 2;
	else return abs(dx - dy) + 2 * dx + 2;
}


#include <iostream>
#include <math.h>

using namespace std;

long long GetTime(long long, long long, long long, long long);

int main()
{
	int n;
	cin >> n;

	int* times = new int[n];

	for (int i = 0; i < n; i++)
	{
		long long x1, y1, x2, y2;
		cin >> x1 >> y1 >> x2 >> y2;

		long long time = GetTime(x1, y1, x2, y2);
		times[i] = time;
	}

	for (int i = 0; i < n; i++)
	{
		cout << times[i] << endl;
	}
}

long long GetTime(long long x1, long long y1, long long x2, long long y2)
{
	long long dx = abs(x2 - x1);
	long long dy = abs(y2 - y1);
	if (x1 == x2) return dy;
	else if (y1 == y2) return dx;
	else if (dx == dy) return 4 * dx;
	else return abs(dx - dy) + 4 * dx;
}


#include <iostream>
#include <math.h>

using namespace std;

long long GetTime(long long, long long, long long, long long);

int main()
{
	int n;
	cin >> n;

	long long* times = new long long[n];

	for (int i = 0; i < n; i++)
	{
		long long x1, y1, x2, y2;
		cin >> x1 >> y1 >> x2 >> y2;

		long long time = GetTime(x1, y1, x2, y2);
		times[i] = time;
	}

	for (int i = 0; i < n; i++)
	{
		cout << times[i] << endl;
	}
}

long long GetTime(long long x1, long long y1, long long x2, long long y2)
{
	long long dx = abs(x2 - x1);
	long long dy = abs(y2 - y1);

	if (x1 == x2) return dy;
	else if (y1 == y2) return dx;
	else if (dx == dy) return 2 * dx + 2;
	else return abs(dx - dy) + 2 * dx + 2;
}


#include <iostream>
#include <math.h>

using namespace std;

long long GetTime(long long, long long, long long, long long);

int main()
{
	int n;
	cin >> n;

	long long* times = new long long[n];

	for (int i = 0; i < n; i++)
	{
		long long x1, y1, x2, y2;
		cin >> x1 >> y1 >> x2 >> y2;

		long long time = GetTime(x1, y1, x2, y2);
		times[i] = time;
	}

	for (int i = 0; i < n; i++)
	{
		cout << times[i] << endl;
	}
}

long long GetTime(long long x1, long long y1, long long x2, long long y2)
{
	long long dx = abs(x2 - x1);
	long long dy = abs(y2 - y1);

	if (x1 == x2) return dy;
	else if (y1 == y2) return dx;
	else if (dx == dy) return 2 * dx + 2;
	else if (dx > dy) return abs(dx - dy) + 2 * dy + 2;
	else return abs(dx < dy) + 2 * dx + 2;
}


#include <iostream>
#include <math.h>

using namespace std;

long long GetTime(long long, long long, long long, long long);

int main()
{
	int n;
	cin >> n;

	int* times = new int[n];

	for (int i = 0; i < n; i++)
	{
		long long x1, y1, x2, y2;
		cin >> x1 >> y1 >> x2 >> y2;

		long long time = GetTime(x1, y1, x2, y2);
		times[i] = time;
	}

	for (int i = 0; i < n; i++)
	{
		cout << times[i];
	}
}

long long GetTime(long long x1, long long y1, long long x2, long long y2)
{
	long long dx = abs(x2 - x1);
	long long dy = abs(y2 - y1);
	if (x1 == x2) return dy;
	else if (y1 == y2) return dx;
	else if (dx == dy) return 4 * dx;
	else return abs(dx - dy) + 4 * dx;
}


#include <iostream>
#include <math.h>

using namespace std;

long long GetTime(long long, long long, long long, long long);

int main()
{
	int n;
	cin >> n;

	long long* times = new long long[n];

	for (int i = 0; i < n; i++)
	{
		long long x1, y1, x2, y2;
		cin >> x1 >> y1 >> x2 >> y2;

		long long time = GetTime(x1, y1, x2, y2);
		times[i] = time;
	}

	for (int i = 0; i < n; i++)
	{
		cout << times[i] << endl;
	}
}

long long GetTime(long long x1, long long y1, long long x2, long long y2)
{
	long long dx = abs(x2 - x1);
	long long dy = abs(y2 - y1);

	if (x1 == x2) return dy;
	else if (y1 == y2) return dx;
	else if (dx == dy) return 2 * dx + 2;
	else return abs(dx - dy) + 4 * dx;
}


#include <iostream>
#include <math.h>

using namespace std;

long long GetTime(long long, long long, long long, long long);

int main()
{
	int n;
	cin >> n;

	int* times = new int[n];

	for (int i = 0; i < n; i++)
	{
		long long x1, y1, x2, y2;
		cin >> x1 >> y1 >> x2 >> y2;

		long long time = GetTime(x1, y1, x2, y2);
		times[i] = time;
	}

	for (int i = 0; i < n; i++)
	{
		cout << times[i] << endl;
	}
}

long long GetTime(long long x1, long long y1, long long x2, long long y2)
{
	long long dx = abs(x2 - x1);
	long long dy = abs(y2 - y1);
	if (x1 == x2) return dy;
	else if (y1 == y2) return dx;
	else if (dx == dy) return 4 * dx;
	else if(dx > dy)
	{
		long long time = 0;
		while (dx > dy)
		{
			time++;
			dx--;
		}

		return time + 4 * dx;
	}
	else if (dy > dx)
	{
		long long time = 0;
		while (dy > dx)
		{
			time++;
			dy--;
		}

		return time + 4 * dx;
	}
}


#include<stdio.h>
#include<conio.h>
#include<math.h>

using namespace std;

int main()
{
    int t,x1,x2,y1,y2;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
        if(abs(y1-y2)!=0)
        printf("%d",abs(x1-x2)+abs(y1-y2)+2);
        else
           printf("%d",abs(x1-x2)+abs(y1-y2));

    }

 return 0;
}


#include<stdio.h>
#include<conio.h>
#include<math.h>

using namespace std;

int main()
{
    int t,x1,x2,y1,y2;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
        if(abs(y1-y2)!=0)
        printf("%d\n",abs(x1-x2)+abs(y1-y2)+2);
        else
           printf("%d\n",abs(x1-x2)+abs(y1-y2));

    }

 return 0;
}


#include<stdio.h>
#include<conio.h>
#include<math.h>
#include<bits/stdc++.h>

using namespace std;

int main()
{
    int t,x1,x2,y1,y2;
    cin>>t;
    while(t--)
    {
        cin>>x1>>y1>>x2>>y2;
        if(abs(y1-y2)!=0)
        cout<<abs(x1-x2)+abs(y1-y2)+2<<endl;
        else
           cout<<abs(x1-x2)+abs(y1-y2)<<endl;

    }

 return 0;
}


#include<stdio.h>
#include<conio.h>
#include<math.h>

using namespace std;

int main()
{
    int t,x1,x2,y1,y2;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
        if(abs(y1-y2)!=0&&abs(x1-x2)!=0)
        printf("%d\n",abs(x1-x2)+abs(y1-y2)+2);
        else
           printf("%d\n",abs(x1-x2)+abs(y1-y2));

    }

 return 0;
}


#include <stdio.h>
#include <conio.h>
#include <iostream>

void main()
{
	int cases=0,steps=0;
	int x1=0, x2=0, y1=0, y2=0;
	std::cin >> cases;
	for (int i = 0; i < cases; i++) {

		std::cin >> x1;
		std::cin >> y1;
		std::cin >> x2;
		std::cin >> y2;
		if (x1 == x2 || y1 == y2) {
			steps = (x2 - x1) + (y2 - y1);
		}
		else {
			steps = (x2 - x1) + (y2 - y1) + 2;
		}
		std::cout << steps;

	}

}


#include <stdio.h>
#include <conio.h>
#include <iostream>

void main()
{
	int cases=0,steps=0;

	std::cin >> cases;
	for (int i = 0; i < cases; i++) {
		int x1 = 0, x2 = 0, y1 = 0, y2 = 0;
		std::cin >> x1 >> y1 >> x2 >> y2;

		if (x1 == x2 || y1 == y2) {
			steps = (x2 - x1) + (y2 - y1);
		}
		else {
			steps = (x2 - x1) + (y2 - y1) + 2;
		}

		std::cout << "\n"+steps;
	}

}


#include <stdio.h>
#include <conio.h>
#include <iostream>
# include <stdlib.h>

void main()
{
	long cases = 0;

	std::cin >> cases;
	for (int i = 0; i < cases; i++) {
		long steps = 0;
		long x1 = 0, x2 = 0, y1 = 0, y2 = 0;
		std::cin >> x1 >> y1 >> x2 >> y2;

		if (x1 == x2 || y1 == y2) {
			steps = (x2 - x1) + (y2 - y1);
		}

		else {
			steps = (x2 - x1) + (y2 - y1) + 2;
		}

		if (steps < 0) {
			steps = steps * -1;
		}

		std::cout << steps << std::endl;

	}

}


#include <stdio.h>
#include <conio.h>
#include <iostream>
# include <stdlib.h>

void main()
{
	int cases = 0;

	std::cin >> cases;
	for (int i = 0; i < cases; i++) {
		long steps = 0;
		long x1 = 0, x2 = 0, y1 = 0, y2 = 0;
		std::cin >> x1 >> y1 >> x2 >> y2;

		if (x1 == x2 || y1 == y2) {
			steps = (x2 - x1) + (y2 - y1);
		}

		else {
			steps = (x2 - x1) + (y2 - y1) + 2;
		}

		if (steps < 0) {
			steps = steps * -1;
		}

		std::cout << steps << std::endl;

	}

}


#include <stdio.h>
#include <conio.h>
#include <iostream>

void main()
{
	long cases = 0;

	std::cin >> cases;
	for (int i = 0; i < cases; i++) {
		long steps = 0;
		long x1 = 0, x2 = 0, y1 = 0, y2 = 0;
		std::cin >> x1 >> y1 >> x2 >> y2;

		if (x1 == x2 || y1 == y2) {
			steps = (x2 - x1) + (y2 - y1);
		}

		else {
			steps = (x2 - x1) + (y2 - y1) + 2;
		}

		if (steps < 0) {
			steps = steps * -1;
		}

		std::cout << steps;
		std::cout << "\n";

	}

}


#include <stdio.h>
#include <conio.h>
#include <iostream>
# include <stdlib.h>
# include <cstdlib>

void main()
{
	int cases = 0;

	std::cin >> cases;
	for (int i = 0; i < cases; i++) {
		long steps = 0;
		long x1 = 0, x2 = 0, y1 = 0, y2 = 0;
		std::cin >> x1 >> y1 >> x2 >> y2;

		if (x1 == x2 || y1 == y2) {
			steps = abs((x2 - x1)) + abs((y2 - y1));
		}

		else {

			steps = abs((x2 - x1)) + abs((y2 - y1)) + 2;
		}

		if (steps < 0) {
			steps = steps * -1;
		}

		std::cout << steps << std::endl;

	}

}


#include <stdio.h>
#include <conio.h>
#include <iostream>

void main()
{
	int cases=0,steps=0;

	std::cin >> cases;
	for (int i = 0; i < cases; i++) {
		int x1 = 0, x2 = 0, y1 = 0, y2 = 0;
		std::cin >> x1 >> y1 >> x2 >> y2;

		if (x1 == x2 || y1 == y2) {
			steps = (x2 - x1) + (y2 - y1);
		}
		else {
			steps = (x2 - x1) + (y2 - y1) + 2;
		}

		std::cout << steps;
		std::cout << "\n";

	}

}


#include <stdio.h>
#include <conio.h>
#include <iostream>

void main()
{
	int cases=0,steps=0;

	std::cin >> cases;
	for (int i = 0; i < cases; i++) {
		int x1 = 0, x2 = 0, y1 = 0, y2 = 0;
		std::cin >> x1 >> y1 >> x2 >> y2;

		if (x1 == x2 || y1 == y2) {
			steps = (x2 - x1) + (y2 - y1);
		}

		else {
			steps = (x2 - x1) + (y2 - y1) + 2;
		}

		if (steps < 0) {
			steps = steps * -1;
		}

		std::cout << steps;
		std::cout << "\n";

	}

}


#include <stdio.h>
#include <conio.h>
#include <iostream>

void main()
{
	int cases=0,steps=0;
	int x1=0, x2=0, y1=0, y2=0;
	std::cin >> cases;
	for (int i = 0; i < cases; i++) {

		std::cin >> x1;
		std::cin >> y1;
		std::cin >> x2;
		std::cin >> y2;
		if (x1 == x2 or y1 == y2) {
			steps = (x2 - x1) + (y2 - y1);
		}
		else {
			steps = (x2 - x1) + (y2 - y1) + 2;
		}
		std::cout << steps;

	}

}


#include <stdio.h>
#include <conio.h>
#include <iostream>

void main()
{
	int cases=0,steps=0;

	std::cin >> cases;
	for (int i = 0; i < cases; i++) {
		int x1 = 0, x2 = 0, y1 = 0, y2 = 0;
		std::cin >> x1 >> y1 >> x2 >> y2;

		if (x1 == x2 || y1 == y2) {
			steps = (x2 - x1) + (y2 - y1);
		}
		else {
			steps = (x2 - x1) + (y2 - y1) + 2;
		}

		std::cout << steps;
	}

}


#include <stdio.h>
#include <conio.h>
#include <iostream>

void main()
{
	int cases=0,steps=0;
	int x1=0, x2=0, y1=0, y2=0;
	std::cin >> cases;
	for (int i = 0; i < cases; i++) {

		std::cin >> x1;
		std::cin >> y1;
		std::cin >> x2;
		std::cin >> y2;
		if (x1 == x2 || y1 == y2) {
			steps = (x2 - x1) + (y2 - y1);
		}
		else {
			steps = (x2 - x1) + (y2 - y1) + 2;
		}
		std::cout << "\n"+steps;

	}

}


#include <iostream>
using namespace std;

int main()
{
	int t; cin >> t;
	for (; t > 0; t--)
	{
		int x1, y1; cin >> x1 >> y1;
		int x2, y2; cin >> x2 >> y2;
		if (x1 == x2 || y1 == y2)
			cout << abs(x1 - x2) + abs(y1 - y2) << endl;
		else
			cout << abs(x1 - x2) + abs(y1 - y2) + 2 << endl;
	}

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <functional>
#include <math.h>
#include <vector>
#include <stack>
#include <string>
#include <algorithm>
#include <iomanip>
#include <set>
#include <queue>

#pragma comment(linker, "/STACK:255999999")
typedef long long ll;
typedef long double ld;
using namespace std;
const ll mod = 1e+9 + 7;
const ll powerer = 271, inver = 450184505;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(10);
  int t, x1, x2, y1, y2;
  vector<int>ans = {};
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    ans.push_back(abs(x1 - x2) + abs(y1 - y2) + ((x1 != x2 && y1 != y2) * 2));
  }
  for (int i = 0; i < t; i++) {
    cout << ans[i] << '\n';
  }
  return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <functional>
#include <math.h>
#include <vector>
#include <stack>
#include <string>
#include <algorithm>
#include <iomanip>
#include <set>
#include <queue>

#pragma comment(linker, "/STACK:255999999")
typedef long long ll;
typedef long double ld;
using namespace std;
const ll mod = 1e+9 + 7;
const ll powerer = 271, inver = 450184505;
int main() {
  cin.tie(0);
  //ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(10);
  int t, x1, x2, y1, y2;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    int ans = abs(x1 - x2) + abs(y1 - y2) + ((x1 != x2 && y1 != y2) * 2);
    cout << ans <<'/n';
  }
  return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <functional>
#include <math.h>
#include <vector>
#include <stack>
#include <string>
#include <algorithm>
#include <iomanip>
#include <set>
#include <queue>

#pragma comment(linker, "/STACK:255999999")
typedef long long ll;
typedef long double ld;
using namespace std;
const ll mod = 1e+9 + 7;
const ll powerer = 271, inver = 450184505;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(10);
  int t, x1, x2, y1, y2;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    cout << abs(x1 - x2) + abs(y1 - y2) + (x1 != x2 && y1 != y2) * 2;
  }
  cout << '=';
  return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>

using namespace std;

int main() {
	int t;
	cin >> t;
	for (int k = 0; k < t; k++) {
		int x1, y1, x2, y2;
		cin >> x1 >> y1 >> x2 >> y2;
		if (x1 == x2) {
			cout << abs(y1 - y2)<<"\n";
		}
		else if (y1 == y2) {
			cout << abs(x1 - x2)<<"\n";
		}
		else {
			cout << abs(x1 - x2) + 2 + abs(y1 - y2)<<"\n";
		}
	}
}


#include <iostream>
#include <cmath>
#define int long long
using namespace std;
signed main()
{
    int T,x1,x2,y1,y2;
    cin>>T;
    while(T--){
        cin>>x1>>y1>>x2>>y2;
        if(x1==x2) cout<<abs(y1-y2)<<endl;
        else if(y1==y2) cout<<abs(x1-x2)<<endl;
        else cout<<abs(x1-x2)+abs(y1-y2)+2<<endl;
    }
    return 0;
}


#include <iostream>
using namespace std;

void solution() {
    long long x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    cout << abs(y2 - y1) + abs(x2 - x1)+2*(x1!=x2 && y1!=y2)<<endl;
}

int main()
{
    int t; cin >> t;
    for (int i = 0; i < t; i++) {
        solution();
    }
}


#include <iostream>
#include <vector>
using namespace std;

int calc(vector<int> start, vector<int> end)
{
    if (start[0]==end[0])
    return abs(start[1]-end[1]);
    else if (start[1]==end[1])
    return abs(start[0]-end[0]);
    else return abs(start[0]-end[0]) + abs(start[1]-end[1]) +2;
}

int main()
{
   int t, a, ans;
   vector<int> start, end;
   cin >> t;
   for (int i=0; i<t; i++)
   {
       for (int j=0; j<2; j++)
       {
           cin >> a;
           start.push_back(a);
       }
       for (int j=0; j<2; j++)
       {
           cin >> a;
           end.push_back(a);
       }
       ans=calc(start,end);
       start.clear();
       end.clear();
       cout << ans << endl;
   }
   return 0;
}


#include <stdlib.h>
#include <time.h>
#include <vector>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <fstream>
#include <string>
#include <map>
#include <set>

using namespace std;

const int M=10000+10;

typedef long long int ll;

int main()
{

	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);

	int t; cin>>t;

	for (int q = 0; q < t; q++){
		ll x1,y1,x2,y2;
		cin>>x1>>y1>>x2>>y2;

		ll d1 = abs(x1 - x2);
		ll d2 = abs(y1 - y2);
		ll d = d1 + d2;
		if (d1 != 0  && d2 != 0){
			d += 2;
		}
		cout<<d<<endl;
	}

	return 0;

};


#include <iostream>
#include <stdlib.h>

using namespace std;

typedef long long ll;

int main() {
    int t;
    ll x1, y1, x2, y2;
    cin >> t;
    while(t--) {
        cin >> x1 >> y1 >> x2 >> y2;
        if (x1 == x2) {
            cout << abs(y1 - y2) << endl;
        }
        else if (y1 == y2) {
            cout << abs(x1 - x2) << endl;
        }
        else if (x1 != x2) {
            ll temp = abs(x1 - x2) + abs(y1 - y2) + 2;
            cout << temp << endl;
        }
        else {
            ll temp = abs(x1 - x2) + abs(y1 - y2) + 2;
            cout << temp << endl;
        }
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <queue>
#include <bitset>
#include <map>
#define rep(i,j,k) for(int i=j;i<=k;++i)
#define drp(i,j,k) for(int i=j;i>=k;--i)
#define isdigit(ch) (ch>=48&&ch<=57)
typedef long long ll;
typedef unsigned long long ull;
inline int read(){
	int x=0;
	bool f=false;
	char ch=getchar();
	while(!isdigit(ch)) f|=ch=='-',ch=getchar();
	while(isdigit(ch)) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
	return f?-x:x;
}
inline int max(int a,int b){return a>b?a:b;}
inline int min(int a,int b){return a<b?a:b;}
int task,a,b,c,d;
int main(){
	task=read();
	while(task--){
		int a=read(),b=read(),c=read(),d=read();
		if(a==c) printf("%d\n",max(b-d,d-b));
		else if(b==d) printf("%d\n",max(a-c,c-a));
		else printf("%d\n",max(a-c,c-a)+max(b-d,d-b)+2);
	}
}


import math
o=int(input())
for i in range(o):
    s=input()
    l=s.split()
    f1=math.fabs(int(l[0])-int(l[2]))
    f2=math.fabs(int(l[1])-int(l[3]))
    if int(l[0])!=int(l[2]) and int(l[1])!=int(l[3]):
        print(int(2+f1+f2))
    else:
        print(int(f1+f2))


o=int(input())
for i in range(o):
    s=input()
    l=s.split()
    if l[0]!=l[2] and l[1]!=l[3]:
        t=2+int(l[0])+int(l[1])-int(l[2])-int(l[3])
        print(t)
    else:
        t=int(l[0])+int(l[1])-int(l[2])-int(l[3])
        print(t)


t = int(input())
for _ in range(t):
    x1, y1, x2, y2 = map(int,input().split())
    print(x1, y1, x2, y2)

    c=0

    if(x1<x2):
        x1 = x1 + 1
        c += 1
        if(y1<y2):
            c+=2
            y1 = y1 + 1
            c += 1
    print(c)


t = int(input())
for _ in range(t):
    x1, y1, x2, y2 = map(int,input().split())

    if x1 == x2:
        print(abs(y2 - y1))
    elif y1 == y2:
        print(abs(x2 - x1))
    else:
        print(abs(x2 - x1) + abs(y2 - y1) + 2)


t = int(input())
for _ in range(t):
    x1, y1, x2, y2 = map(int, input().split())

    c = 0

    if (x1 < x2):
        x1 = x1 + 1
        c += 1
        if (y1 < y2):
            c += 2
            y1 = y1 + 1
            c += 1
    print(c)


t = int(input())
for _ in range(t):
    x1, y1, x2, y2 = map(int,input().split())

    if x1 == x2:
        print(y2 - y1)
    elif y1 == y2:
        print(x2 - x1)
    else:
        print((x2 - x1) + (y2 - y1) + 2)


test=int(input())
for i in range(test):
    a,b,c,d=list(map(int,input().split()))
    x=a+1
    y=d+1
    if a==b==c==d:
        print(1)
    elif a==c:
        print(abs(b-d))
    else:
        ans=((x-c)**2)+((y-b)**2)
        print(ans)


test=int(input())
for i in range(test):
    a,b,c,d=list(map(int,input().split()))
    if a==c:
        print(abs(b-d))
    elif b==d:
        print(abs(a-c))
    else:
        print(abs(a-c)+abs(b-d)+2)


test=int(input())
for i in range(test):
    a,b,c,d=list(map(int,input().split()))
    x=(abs(a-c))+(abs(b-d))
    print(x**2)


test=int(input())
for i in range(test):
    a,b,c,d=list(map(int,input().split()))
    x=a+1
    y=d+1
    if a==b==c==d:
        print(1)
    else:
        ans=((x-c)**2)+((y-b)**2)
        print(ans)


test=int(input())
for i in range(test):
    a,b,c,d=list(map(int,input().split()))
    x=a+1
    y=d+1
    ans=((x-c)**2)+((y-b)**2)
    print(ans)


t=int(input())
while t>0:
    t-=1
    a,b,c,d=map(int,input().split())
    xd=abs(a,c)
    yd=abs(b-d)
    if( not xd and not yd):
        print(xd+yd+2)
    else:
        print(xd+yd)


t=int(input())
while t>0:
    t-=1
    a,b,c,d=map(int,input().split())
    xd=abs(a-c)
    yd=abs(b-d)
    if( xd>0 and  yd>0):
        print(xd+yd+2)
    else:
        print(xd+yd)