#include <iostream>
#include <cstdio>
#include <vector>
#include <math.h>
#include <algorithm>
#include <string>
#include <cstring>
#include <string.h>
#include <cstdlib>
#include <sstream>
#include <stack>
#include <queue>
#include <numeric>
#include <utility>
#include <cctype>
#include <list>
#include <limits.h>
#include <signal.h>
#include <map>
#include <set>

using namespace std;

double const eps=1e-8;

int main() {
    double y1,y2,yw,xb,yb,r;
    double xw1,xw2,xw,y_xw,y_xw_1,y_xw_2,d;
    cin>>y1>>y2>>yw>>xb>>yb>>r;
/*    xw1=((yw-y2)*xb)/(2*yw-yb-y2);
    xw2=((yw-y1)*xb)/(2*yw-yb-y1);
    xw=(xw1+xw2)/2;
  //  cout<<xw1<<"\n"<<xw2<<"\n"<<xw<<endl;
    y_xw=((yw*(xb-xw))-(xw*(yw-yb)))/(xb-xw);
  //  cout<<y_xw<<endl;
    y_xw_1=y_xw-r;
    y_xw_2=y_xw+r;
  //  cout<<y_xw_1<<"\n"<<y_xw_2<<endl;
    if(y_xw_1<y1 || y_xw_2>y2){
        cout<<"-1"<<endl;
    }else{
        cout<<xw<<endl;
    }
 */
    xw=xb/(((yw-r-yb)/(yw-y1-2*r))+1);
    d=(-y2+y1+r)/sqrt(((yw-y1-2*r)/xw)+1);
    if(d<0)d=-d;
    if(d<r+eps){
        cout<<"-1"<<endl;
    }else{
        cout<<xw<<endl;
    }
 //   system("pause");
    return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <math.h>
#include <algorithm>
#include <string>
#include <cstring>
#include <string.h>
#include <cstdlib>
#include <sstream>
#include <stack>
#include <queue>
#include <numeric>
#include <utility>
#include <cctype>
#include <list>
#include <limits.h>
#include <signal.h>
#include <map>
#include <set>

using namespace std;

double const eps=1e-8;

int main() {
    double y1,y2,yw,xb,yb,r;
    double xw1,xw2,xw,y_xw,y_xw_1,y_xw_2,d;
    cin>>y1>>y2>>yw>>xb>>yb>>r;
/*    xw1=((yw-y2)*xb)/(2*yw-yb-y2);
    xw2=((yw-y1)*xb)/(2*yw-yb-y1);

    xw=(xw1+xw2)/2;
  //  cout<<xw1<<"\n"<<xw2<<"\n"<<xw<<endl;
    y_xw=((yw*(xb-xw))-(xw*(yw-yb)))/(xb-xw);
  //  cout<<y_xw<<endl;
    y_xw_1=y_xw-r;
    y_xw_2=y_xw+r;
  //  cout<<y_xw_1<<"\n"<<y_xw_2<<endl;
    if(y_xw_1<y1 || y_xw_2>y2){
        cout<<"-1"<<endl;
    }else{
        cout<<xw<<endl;
    }
 */
    xw=xb/(((yw-r-yb)/(yw-y1-2*r))+1);
    d=(-y2+y1+r)/sqrt( ( ((yw-y1-2*r)/xw)*((yw-y1-2*r)/xw) )+1);
    if(d<0)d=-d;
    if(d<r+eps){
        cout<<"-1"<<endl;
    }else{
        printf("%.9lf\n",xw);
    }
   // system("pause");
    return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <math.h>
#include <algorithm>
#include <string>
#include <cstring>
#include <string.h>
#include <cstdlib>
#include <sstream>
#include <stack>
#include <queue>
#include <numeric>
#include <utility>
#include <cctype>
#include <list>
#include <limits.h>
#include <signal.h>
#include <map>
#include <set>

using namespace std;

int main() {
    double y1,y2,yw,xb,yb,r;
    double xw1,xw2,xw,y_xw,y_xw_1,y_xw_2;
    cin>>y1>>y2>>yw>>xb>>yb>>r;
    xw1=((yw-y2)*xb)/(2*yw-yb-y2);
    xw2=((yw-y1)*xb)/(2*yw-yb-y1);
    xw=(xw1+xw2)/2;
  //  cout<<xw1<<"\n"<<xw2<<"\n"<<xw<<endl;
    y_xw=((yw*(xb-xw))-(xw*(yw-yb)))/(xb-xw);
  //  cout<<y_xw<<endl;
    y_xw_1=y_xw-r;
    y_xw_2=y_xw+r;
  //  cout<<y_xw_1<<"\n"<<y_xw_2<<endl;
    if(y_xw_1<y1 || y_xw_2>y2){
        cout<<"-1"<<endl;
    }else{
        cout<<xw<<endl;
    }

  //  system("pause");
    return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <math.h>
#include <algorithm>
#include <string>
#include <cstring>
#include <string.h>
#include <cstdlib>
#include <sstream>
#include <stack>
#include <queue>
#include <numeric>
#include <utility>
#include <cctype>
#include <list>
#include <limits.h>
#include <signal.h>
#include <map>
#include <set>

using namespace std;

double const eps=1e-8;

int main() {
    double y1,y2,yw,xb,yb,r;
    double xw1,xw2,xw,y_xw,y_xw_1,y_xw_2,d;
    cin>>y1>>y2>>yw>>xb>>yb>>r;
/*    xw1=((yw-y2)*xb)/(2*yw-yb-y2);
    xw2=((yw-y1)*xb)/(2*yw-yb-y1);

    xw=(xw1+xw2)/2;
  //  cout<<xw1<<"\n"<<xw2<<"\n"<<xw<<endl;
    y_xw=((yw*(xb-xw))-(xw*(yw-yb)))/(xb-xw);
  //  cout<<y_xw<<endl;
    y_xw_1=y_xw-r;
    y_xw_2=y_xw+r;
  //  cout<<y_xw_1<<"\n"<<y_xw_2<<endl;
    if(y_xw_1<y1 || y_xw_2>y2){
        cout<<"-1"<<endl;
    }else{
        cout<<xw<<endl;
    }
 */
    xw=xb/(((yw-r-yb)/(yw-y1-2*r))+1);
    d=(-y2+y1+r)/sqrt( ( ((yw-y1-2*r)/xw)*((yw-y1-2*r)/xw) )+1);
    if(d<0)d=-d;
    if(d<r+eps){
        cout<<"-1"<<endl;
    }else{
        cout<<xw<<endl;
    }
 //   system("pause");
    return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <math.h>
#include <algorithm>
#include <string>
#include <cstring>
#include <string.h>
#include <cstdlib>
#include <sstream>
#include <stack>
#include <queue>
#include <numeric>
#include <utility>
#include <cctype>
#include <list>
#include <limits.h>
#include <signal.h>
#include <map>
#include <set>

using namespace std;

int main() {
    double y1,y2,yw,xb,yb,r;
    double xw1,xw2,xw,y_xw,y_xw_1,y_xw_2,d;
    cin>>y1>>y2>>yw>>xb>>yb>>r;
/*    xw1=((yw-y2)*xb)/(2*yw-yb-y2);
    xw2=((yw-y1)*xb)/(2*yw-yb-y1);
    xw=(xw1+xw2)/2;
  //  cout<<xw1<<"\n"<<xw2<<"\n"<<xw<<endl;
    y_xw=((yw*(xb-xw))-(xw*(yw-yb)))/(xb-xw);
  //  cout<<y_xw<<endl;
    y_xw_1=y_xw-r;
    y_xw_2=y_xw+r;
  //  cout<<y_xw_1<<"\n"<<y_xw_2<<endl;
    if(y_xw_1<y1 || y_xw_2>y2){
        cout<<"-1"<<endl;
    }else{
        cout<<xw<<endl;
    }
 */
    xw=xb/(((yw-r-yb)/(yw-y1-2*r))+1);
    d=(-y2+y1+r)/sqrt(((yw-y1-2*r)/xw)+1);
    if(d<0)d=-d;
    if(d>r){
        cout<<xw<<endl;
    }else{
        cout<<"-1"<<endl;
    }
 //   system("pause");
    return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <math.h>
#include <algorithm>
#include <string>
#include <cstring>
#include <string.h>
#include <cstdlib>
#include <sstream>
#include <stack>
#include <queue>
#include <numeric>
#include <utility>
#include <cctype>
#include <list>
#include <limits.h>
#include <signal.h>
#include <map>
#include <set>

using namespace std;

int main() {
    long long double y1,y2,yw,xb,yb,r;
    long long double xw1,xw2,xw,y_xw,y_xw_1,y_xw_2;
    cin>>y1>>y2>>yw>>xb>>yb>>r;
    xw1=((yw-y2)*xb)/(2*yw-yb-y2);
    xw2=((yw-y1)*xb)/(2*yw-yb-y1);
    xw=(xw1+xw2)/2;
  //  cout<<xw1<<"\n"<<xw2<<"\n"<<xw<<endl;
    y_xw=((yw*(xb-xw))-(xw*(yw-yb)))/(xb-xw);
  //  cout<<y_xw<<endl;
    y_xw_1=y_xw-r;
    y_xw_2=y_xw+r;
  //  cout<<y_xw_1<<"\n"<<y_xw_2<<endl;
    if(y_xw_1<y1 || y_xw_2>y2){
        cout<<"-1"<<endl;
    }else{
        cout<<xw<<endl;
    }

  //  system("pause");
    return 0;
}


#include<cstdio>
#include<cmath>
#include<iostream>
using namespace std;
int y11, y22, yw, xb, yb, r;
double check(double yt){
	double yp = yw-r, xx = xb, yy = 2*yp-yb, xp, k;
	k = (yy-yt)/xx;
	xp = (yp-yt)/k;
	if(xp < 0)return -100000.0;
	double l = fabs((double(y22)-yt)/sqrt(1+k*k));
	if(l < double(r))return -100000.0;
	return xp;
}
int main(){
	//freopen("a.in", "r", stdin);
	cin>>y11>>y22>>yw>>xb>>yb>>r;
	double step = double(y22-y11-2*r)/1e7;
	if(yw < yb+r){
		printf("-1\n");
		return 0;
	}
	for(double i = double(y11+r);i<=double(y22-r);i+=step){
		double ans = check(i);
		if(ans > 0.0){
			printf("%.10lf\n", ans);
			return 0;
		}
	}
	printf("-1\n");
	return 0;
}


#include<cstdio>
#include<cmath>
#include<iostream>
using namespace std;
int y11, y22, yw, xb, yb, r;
double check(double yt){
	double yp = yw-r, xx = xb, yy = 2*yp-yb, xp, k;
	k = (yy-yt)/xx;
	xp = (yp-yt)/k;
	if(xp < 0)return -100000.0;
	double l = fabs(double(y22-yt)/sqrt(1+k*k));
	if(l < double(r))return -100000.0;
	return xp;
}
int main(){
	//freopen("a.in", "r", stdin);
	cin>>y11>>y22>>yw>>xb>>yb>>r;
	double step = double(y22-y11-2*r)/1e7;
	if(yw < yb+r){
		printf("-1\n");
		return 0;
	}
	for(double i = y22-r;i>double(y11+r);i-=step){
		double ans = check(i);
		if(ans > 0.0){
			printf("%.8lf\n", ans);
			return 0;
		}
	}
	printf("-1\n");
	return 0;
}


#include<cstdio>
#include<cmath>
#include<iostream>
using namespace std;
int y11, y22, yw, xb, yb, r;
double check(double yt){
	double yp = yw-r, xx = xb, yy = 2*yp-yb, xp, k;
	k = (yy-yt)/xx;
	xp = (yp-yt)/k;
	if(xp < 0)return -100000.0;
	double l = (double(y22-r)-yt)/sqrt(1+k*k);
	if(l < double(r))return -100000.0;
	return xp;
}
int main(){
	//freopen("a.in", "r", stdin);
	cin>>y11>>y22>>yw>>xb>>yb>>r;
	double step = double(y22-y11-2*r)/1e7;
	if(yw-r < yb+r){
		printf("-1\n");
		return 0;
	}
	for(double i = y22-r;i>double(y11+r);i-=step){
		double ans = check(i);
		if(ans > 0.0){
			printf("%.8lf\n", ans);
			return 0;
		}
	}
	printf("-1\n");
	return 0;
}


#include<cstdio>
#include<cmath>
#include<iostream>
using namespace std;
int y11, y22, yw, xb, yb, r;
double check(double yt){
	double yp = yw-r, xx = xb, yy = 2*yp-yb, xp, k, b;
	k = (yy-yt)/(xx-r);b = yt-k*r;
	xp = (yp-b)/k;
	if(xp < 0)return -100000.0;
	double l = fabs(double(y22-r*k-b)/sqrt(1+k*k));
	if(l < double(r))return -100000.0;
	return xp;
}
int main(){
	//freopen("a.in", "r", stdin);
	cin>>y11>>y22>>yw>>xb>>yb>>r;
	double step = double(y22-y11-2*r)/1e7;
	if((yw < yb+r)||(xb <= r)){
		printf("-1\n");
		return 0;
	}
	for(double i = y22;i>double(y11);i-=step){
		double ans = check(i);
		if(ans > 0.0){
			printf("%.8lf\n", ans);
			return 0;
		}
	}
	printf("-1\n");
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll 		long long
#define mp 		make_pair
#define sz(v) 	(int)v.size()
#define pb    	push_back
#define b_p(n)		__builtin_popcount(n)
#define s second
#define f first

bool AreSame(double a, double b) {
	return fabs(a - b) < 2.22045e-016;
}
//Y1, Y2, Yw, Xb, Yb, r
int main() {
	double Y1, Y2, Yw, Xb, Yb, r;
	cin >> Y1 >> Y2 >> Yw >> Xb >> Yb >> r;

	double Z = (Yw - Y1 - 2 * r) / (Yw - Yb - r);
	double Z1 = (Yw - Y2) / (Yw - Yb - r);
	double g = (Xb * Z) / (1 + Z);
	double g1 = (Xb * Z1) / (1 + Z1);
	if (g1 < r || g < r)
		cout << -1 << endl;
	else
		cout<<fixed<<setprecision(8)<<g<<endl;
		return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll 		long long
#define mp 		make_pair
#define sz(v) 	(int)v.size()
#define pb    	push_back
#define b_p(n)		__builtin_popcount(n)
#define s second
#define f first

bool AreSame(double a, double b) {
	return fabs(a - b) < 2.22045e-016;
}
//Y1, Y2, Yw, Xb, Yb, r
int main() {
	double Y1, Y2, Yw, Xb, Yb, r;
	cin >> Y1 >> Y2 >> Yw >> Xb >> Yb >> r;
	if (Y2 - Y1 < r) {
		cout << -1 << endl;
		return 0;
	}
	double Z = (Yw - Y1 - r) / (Yw - Yb);
	double Xw = Xb * Z / (1 + Z);
	if (Xw == 1)
		cout << -1 << endl;
	else
		cout << Xw << endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll 		long long
#define mp 		make_pair
#define sz(v) 	(int)v.size()
#define pb    	push_back
#define b_p(n)		__builtin_popcount(n)
#define s second
#define f first
const double EPS = 1e-8;

bool AreSame(double a, double b) {
	return fabs(a - b) < 2.22045e-016;
}
//Y1, Y2, Yw, Xb, Yb, r
int main() {
	double Y1, Y2, Yw, Xb, Yb, r;
	cin >> Y1 >> Y2 >> Yw >> Xb >> Yb >> r;

	double Z = (Yw - Y1 - 2 * r) / (Yw - Yb - r);
	double g = (Xb * Z) / (1 + Z);

	if(  (g*(Y2-Y1+r)/(Yw-Y1-2*r)) -r <= EPS  || r>=g )
		cout<<-1<<endl;
	else
		 cout << setprecision(8) << fixed << g<< endl;
		return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll 		long long
#define mp 		make_pair
#define sz(v) 	(int)v.size()
#define pb    	push_back
#define b_p(n)		__builtin_popcount(n)
#define s second
#define f first
const double EPS = 1e-8;

bool AreSame(double a, double b) {
	return fabs(a - b) < 2.22045e-016;
}
//Y1, Y2, Yw, Xb, Yb, r
int main() {
	double Y1, Y2, Yw, Xb, Yb, r;
	cin >> Y1 >> Y2 >> Yw >> Xb >> Yb >> r;

	double Z = (Yw - Y1 - 2 * r) / (Yw - Yb - r);
	double g = (Xb * Z) / (1 + Z);
	double R = (Y2 - Y1 - r) * (Xb - g)
			/ sqrt(((Yw - r - Yb) * (Yw - r - Yb)) + ((Xb - g) * (Xb - g)));
	if ( R -r< EPS) {
		cout << -1 << endl;
	}

	else
		cout << setprecision(8) << fixed << g << endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll 		long long
#define mp 		make_pair
#define sz(v) 	(int)v.size()
#define pb    	push_back
#define b_p(n)		__builtin_popcount(n)
#define s second
#define f first

//y1, y2, yw, xb, yb, r
int main() {
	ios::sync_with_stdio(false);
	double y1, y2, yw, xb, yb, r;
	cin >> y1 >> y2 >> yw >> xb >> yb >> r;
	if (y2 - y1 < r) {
		cout << -1 << endl;
		return 0;
	}
	double z = (yw - y2 + r) / (yw-yb);
	cout << (z * xb) / (z + 1);
	return 0;
}


#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;

#define EPS 1e-12
#define point pair<double, double>
#define X first
#define Y second
#define sqr(x) ((x)*(x))

point getTopWallIntercept(point start, double topwall, double theta)
{
    double known = topwall - start.Y;
    double x = tan(theta) * known;
    return point(start.X - x, topwall);
}

point getYAxisIntercept(point start, double theta)
{
    double slope = 1.0 / (tan(theta));
    double intercept = start.Y - (slope * start.X);
    return point(0.0, intercept);
}

double distToLine(point p0, point p1, point p2)
{
    return (fabs( ((p2.X - p1.X)*(p1.Y - p0.Y)) - ((p1.X - p0.X)*(p2.Y-p1.Y)) ) )/ sqrt(sqr(p2.X-p1.X) + sqr(p2.Y-p1.Y));
}

int main(void)
{
    double y1, y2, yw, xb, yb, r;
    cin >> y1 >> y2 >> yw >> xb >> yb >> r;

    r+= EPS;
    if(y1 > y2)
    {
        double temp = y1;
        y1 = y2;
        y2 = temp;
    }

    double reflwall = yw - r;
    double refly1, refly2;
    refly1 = reflwall - y1 >= r ? reflwall + (reflwall - y1) : reflwall;
    refly2 = reflwall - y2 >= r ? reflwall + (reflwall - y2) : reflwall;

    if(refly1 == refly2)
    {
        cout << -1 << '\n';
    }

    double mymin = (0.0, atan(xb / (refly1 - yb) ));
    double mymax = min(M_PI / 2.0, atan(xb / (refly2 - yb) ));

    double curr = (mymax + mymin) / 2.0;
    double intersect;
    point myminpoint(0, y1);
    point mymaxpoint(0, y2);
    point start(xb, yb);
    point py1(0, y1);
    point py2(0, y2);

    point topWallIntercept = getTopWallIntercept(start, reflwall, curr);
    point yAxisIntercept = getYAxisIntercept(topWallIntercept, curr);

    int tries = 0;
    while( (tries < 200) && (distToLine(py1, yAxisIntercept, topWallIntercept) < r
           || distToLine(py2, yAxisIntercept, topWallIntercept) < r))
    {
        if(topWallIntercept.X > start.X)
        {
            cout << "WHYYYY\n";
        }
        tries++;
        if( distToLine(py1, yAxisIntercept, topWallIntercept) < r)
        {
            mymin = curr;
            curr = (mymin + mymax) / 2;
        }
        else //(distToLine(py2, yAxisIntercept, topWallIntercept) < r)
        {
            mymax = curr;
            curr = (mymin + mymax) / 2;
        }

        topWallIntercept = getTopWallIntercept(start, reflwall, curr);
        yAxisIntercept = getYAxisIntercept(topWallIntercept, curr);
    }

    if(tries == 200)
        cout << -1 << '\n';
    else
        cout << fixed << setprecision(12) << topWallIntercept.X << '\n';
    //binary search!
    //1: compute the top wall intercept
    //2: using the top wall, compute the y axis intercept
    //3: if distToLine(myminPoint, yAxisIntercept, xAxisIntercept) < r
        //bump up by half
         // else if distToLine(myminPoint, yAxisIntercept, xAxisIntercept) < r
            //bump down by half

}


#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;

#define EPS 1e-12
#define point pair<double, double>
#define X first
#define Y second
#define sqr(x) ((x)*(x))

point getTopWallIntercept(point start, double topwall, double theta)
{
    double known = topwall - start.Y;
    double x = tan(theta) * known;
    return point(start.X - x, topwall);
}

point getYAxisIntercept(point start, double theta)
{
    double slope = 1.0 / (tan(theta));
    double intercept = start.Y - (slope * start.X);
    return point(0.0, intercept);
}

double distToLine(point p0, point p1, point p2)
{
    return (fabs( ((p2.X - p1.X)*(p1.Y - p0.Y)) - ((p1.X - p0.X)*(p2.Y-p1.Y)) ) )/ sqrt(sqr(p2.X-p1.X) + sqr(p2.Y-p1.Y));
}

int main(void)
{
    double y1, y2, yw, xb, yb, r;
    cin >> y1 >> y2 >> yw >> xb >> yb >> r;

    if(y1 > y2)
    {
        double temp = y1;
        y1 = y2;
        y2 = temp;
    }

    double reflwall = yw - r;
    double refly1 = reflwall + (reflwall - y1);
    double refly2 = reflwall + (reflwall - y2);

    double mymin = atan(xb / (refly1 - yb) );
    double mymax = atan(xb / (refly2 - yb) );

    double curr = (mymax + mymin) / 2.0;
    double intersect;
    point myminpoint(0, y1);
    point mymaxpoint(0, y2);
    point start(xb, yb);
    point py1(0, y1);
    point py2(0, y2);

    point topWallIntercept = getTopWallIntercept(start, reflwall, curr);
    point yAxisIntercept = getYAxisIntercept(topWallIntercept, curr);
    int tries = 0;
    while( (tries < 200) && (distToLine(py1, yAxisIntercept, topWallIntercept) < r
           || distToLine(py2, yAxisIntercept, topWallIntercept) < r))
    {
        tries++;
        if( distToLine(py1, yAxisIntercept, topWallIntercept) < r)
        {
            mymin = curr;
            curr = (mymin + mymax) / 2;
        }
        else //(distToLine(py2, yAxisIntercept, topWallIntercept) < r)
        {
            mymax = curr;
            curr = (mymin + mymax) / 2;
        }

        topWallIntercept = getTopWallIntercept(start, reflwall, curr);
        yAxisIntercept = getYAxisIntercept(topWallIntercept, curr);
    }
    if(tries == 200)
        cout << -1 << '\n';
    else
        cout << topWallIntercept.X << '\n';
    //binary search!
    //1: compute the top wall intercept
    //2: using the top wall, compute the y axis intercept
    //3: if distToLine(myminPoint, yAxisIntercept, xAxisIntercept) < r
        //bump up by half
         // else if distToLine(myminPoint, yAxisIntercept, xAxisIntercept) < r
            //bump down by half

}


#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;

#define EPS 1e-12
#define sqr(x) ((x)*(x))

// 2D Geometry - Points as DOUBLES :D
struct point{
    double x,y;
    point(double x, double y) : x(x), y(y)  {}
    point() : x(0) ,y (0) {}
    point (const point &p) : x(p.x), y(p.y) {}

    point operator + (const point &p) const {
        return point(p.x + x, p.y + y);
    }
    point operator - (const point &p) const
    {
        return point(x - p.x, y - p.y);
    }
    point operator * (const double c) const
    {
        return point(x * c, y * c);
    }
    point operator / (const double c) const
    {
        return point(x/c, y/c);
    }

    //UNTESTED UNSAFE BE WARY
    bool operator == (const point &p) const
    {
        return   (x - p.x < EPS && p.x - x < EPS)
              && (y - p.y < EPS && p.y - y < EPS);
    }
};

// POINT - 2 DIMENSIONAL
// pretty print
ostream&operator<<(ostream &out, const point &p)
{
    out << "(" << p.x << "," << p.y << ")";
    return out;
}

// DOUBLE POINT - 2 DIMENSIONAL
// return the square of magnitude of p
double mag2(const point &p)
{
    return (sqr(p.x) + sqr(p.y) );
}

// DOUBLE POINT - 2 DIMENSIONAL
// return the magnitude of p
double mag(const point &p)
{
    return sqrt(mag2(p));
}

// DOUBLE POINT - 2 DIMENSIONAL
// distance squared between two points
double dist2(const point &p, const point &q)
{
    return (sqr(p.x-q.x) + sqr(p.y-q.y));
}

// DOUBLE POINT - 2 DIMENSIONAL
// distance between two points
double dist(const point &p, const point &q)
{
    return sqrt(dist2(p, q));
}

// DOUBLE DOT - 2 DIMENSIONAL
//compute the dot product: x1->x0 DOT x1->x2
double dot(point x0, point x1, point x2){
    point a = x0 - x1;
    point b = x2 - x1;
    return (a.x * b.x) + (a.y * b.y);
}

// DOUBLE POINT - 2 DIMENSIONAL
// cross product of two points
// note that we are not returning the vector, only its magnitude and +/-
double cross(const point &p, const point &q)
{
    return (p.x * q.y) - (q.x * p.y);
}

//computes the distance from x0 to the line (segment?) formed by x1, x2
//we should probably extend this to include rays
double linePointDist(point x0, point x1, point x2, bool isSegment)
{
    if(isSegment)
    {
        double dot1 = dot(x0,x1,x2);
        if(dot1 <= 0)
            return dist(x0, x1);
        double dot2 = dot(x0,x2,x1);
        if(dot2 <= 0)
            return dist(x0, x2);
    }

    point num1 = x0 - x1;
    point num2 = x0 - x2;
    double num = cross(num1, num2);
    point denom = x2 - x1;
    double result = ( fabs(num) ) / ( mag(denom) );
    return result;
}

int main(void)
{
    double y1, y2, yw, xb, yb, r;
    cin >> y1 >> y2 >> yw >> xb >> yb >> r;

    if(y1 > y2)
    {
        double temp = y1;
        y1 = y2;
        y2 = temp;
    }

    point ball(xb, yb);
    //track the trajectory of the center of the ball
    yw -= r;

    // binary search
    double left = 0.0;
    double right = xb;
    double middle = (left + right) / 2.0;
    bool found = false;
    point wallbounce, intercept;
    point y1p(0.0, y1);
    point y2p(0.0, y2);
    for(int i = 0; i < 200; i++)
    {
        wallbounce = point(middle, yw);
        double rise = yw - ball.y;
        double run = ball.x - middle;
        double slope = rise / run;
        double yintercept = wallbounce.y - (wallbounce.x * slope);
        intercept = point(0.0, yintercept);

        //case 1: too far left
        if(intercept.y >= y2 || linePointDist(y2p, wallbounce, intercept, true) <= r)
        {
            left = middle;
            middle = (left + right) / 2.0;
        }
        //case 2: too far left
        else if(intercept.y <= y1 || linePointDist(y1p, wallbounce, intercept, true) <= r)
        {
            right = middle;
            middle = (left + right) / 2.0;
        }
        else
        {
            found = true;
            break;
        }
    }

    if(found == true)
        cout << fixed << setprecision(10) << middle << '\n';
    else
        cout << -1 << '\n';
}


#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;

#define EPS 1e-12
#define point pair<double, double>
#define X first
#define Y second
#define sqr(x) ((x)*(x))

point getTopWallIntercept(point start, double topwall, double theta)
{
    double known = topwall - start.Y;
    double x = tan(theta) * known;
    return point(start.X - x, topwall);
}

point getYAxisIntercept(point start, double theta)
{
    double slope = 1.0 / (tan(theta));
    double intercept = start.Y - (slope * start.X);
    return point(0.0, intercept);
}

double distToLine(point p0, point p1, point p2)
{
    return (fabs( ((p2.X - p1.X)*(p1.Y - p0.Y)) - ((p1.X - p0.X)*(p2.Y-p1.Y)) ) )/ sqrt(sqr(p2.X-p1.X) + sqr(p2.Y-p1.Y));
}

int main(void)
{
    double y1, y2, yw, xb, yb, r;
    cin >> y1 >> y2 >> yw >> xb >> yb >> r;

    r+= EPS;
    if(y1 > y2)
    {
        double temp = y1;
        y1 = y2;
        y2 = temp;
    }

    double reflwall = yw - r;
    double refly1 = max(reflwall, reflwall + (reflwall - y1));
    double refly2 = max(reflwall, reflwall + (reflwall - y2));

    double mymin = min(0.0, atan(xb / (refly1 - yb) ));
    double mymax = min(M_PI / 2.0, atan(xb / (refly2 - yb) ));

    double curr = (mymax + mymin) / 2.0;
    double intersect;
    point myminpoint(0, y1);
    point mymaxpoint(0, y2);
    point start(xb, yb);
    point py1(0, y1);
    point py2(0, y2);

    point topWallIntercept = getTopWallIntercept(start, reflwall, curr);
    point yAxisIntercept = getYAxisIntercept(topWallIntercept, curr);

    int tries = 0;
    while( (tries < 200) && (distToLine(py1, yAxisIntercept, topWallIntercept) < r
           || distToLine(py2, yAxisIntercept, topWallIntercept) < r))
    {
        if(topWallIntercept.X > start.X)
        {
            cout << "WHYYYY\n";
        }
        tries++;
        if( distToLine(py1, yAxisIntercept, topWallIntercept) < r)
        {
            mymin = curr;
            curr = (mymin + mymax) / 2;
        }
        else //(distToLine(py2, yAxisIntercept, topWallIntercept) < r)
        {
            mymax = curr;
            curr = (mymin + mymax) / 2;
        }

        topWallIntercept = getTopWallIntercept(start, reflwall, curr);
        yAxisIntercept = getYAxisIntercept(topWallIntercept, curr);
    }

    if(tries == 200)
        cout << -1 << '\n';
    else
        cout << fixed << setprecision(12) << topWallIntercept.X << '\n';
    //binary search!
    //1: compute the top wall intercept
    //2: using the top wall, compute the y axis intercept
    //3: if distToLine(myminPoint, yAxisIntercept, xAxisIntercept) < r
        //bump up by half
         // else if distToLine(myminPoint, yAxisIntercept, xAxisIntercept) < r
            //bump down by half

}


#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;

#define EPS 1e-12
#define point pair<double, double>
#define X first
#define Y second
#define sqr(x) ((x)*(x))

point getTopWallIntercept(point start, double topwall, double theta)
{
    double known = topwall - start.Y;
    double x = tan(theta) * known;
    return point(start.X - x, topwall);
}

point getYAxisIntercept(point start, double theta)
{
    double slope = 1.0 / (tan(theta));
    double intercept = start.Y - (slope * start.X);
    return point(0.0, intercept);
}

double distToLine(point p0, point p1, point p2)
{
    return (fabs( ((p2.X - p1.X)*(p1.Y - p0.Y)) - ((p1.X - p0.X)*(p2.Y-p1.Y)) ) )/ sqrt(sqr(p2.X-p1.X) + sqr(p2.Y-p1.Y));
}

int main(void)
{
    double y1, y2, yw, xb, yb, r;
    cin >> y1 >> y2 >> yw >> xb >> yb >> r;

    r+= EPS;
    if(y1 > y2)
    {
        double temp = y1;
        y1 = y2;
        y2 = temp;
    }

    double reflwall = yw - r;
    double refly1 = reflwall + (reflwall - y1);
    double refly2 = reflwall + (reflwall - y2);

    double mymin = atan(xb / (refly1 - yb) );
    double mymax = atan(xb / (refly2 - yb) );

    double curr = (mymax + mymin) / 2.0;
    double intersect;
    point myminpoint(0, y1);
    point mymaxpoint(0, y2);
    point start(xb, yb);
    point py1(0, y1);
    point py2(0, y2);

    point topWallIntercept = getTopWallIntercept(start, reflwall, curr);
    point yAxisIntercept = getYAxisIntercept(topWallIntercept, curr);
    int tries = 0;
    while( (tries < 200) && (distToLine(py1, yAxisIntercept, topWallIntercept) < r
           || distToLine(py2, yAxisIntercept, topWallIntercept) < r))
    {
        tries++;
        if( distToLine(py1, yAxisIntercept, topWallIntercept) < r)
        {
            mymin = curr;
            curr = (mymin + mymax) / 2;
        }
        else //(distToLine(py2, yAxisIntercept, topWallIntercept) < r)
        {
            mymax = curr;
            curr = (mymin + mymax) / 2;
        }

        topWallIntercept = getTopWallIntercept(start, reflwall, curr);
        yAxisIntercept = getYAxisIntercept(topWallIntercept, curr);
    }

    if(tries == 200)
        cout << -1 << '\n';
    else
        cout << fixed << setprecision(12) << topWallIntercept.X << '\n';
    //binary search!
    //1: compute the top wall intercept
    //2: using the top wall, compute the y axis intercept
    //3: if distToLine(myminPoint, yAxisIntercept, xAxisIntercept) < r
        //bump up by half
         // else if distToLine(myminPoint, yAxisIntercept, xAxisIntercept) < r
            //bump down by half

}


#include <iostream>
#include <set>
#include <string>
#include <vector>
#include <sstream>
#include <cmath>
#include <cstdio>
#include <list>
#include <algorithm>

using namespace std;

double distance(long ax,long ay,long bx,long by,long px,long py){
	double normalLength = sqrt((bx-ax)*(bx-ax) + (by-ay)*(by-ay));
	return ((double) abs((px-ax)*(by-ay) - (py-ay)*(bx-ax)))/normalLength;
}

int main()
{
	long y1x,y2x,yw,xb,yb,r;
	cin >> y1x >> y2x >> yw >> xb >> yb >> r;

	long y1 = yw + yw - y2x;
	long y2 = yw + yw - y1x;

	long yx = y2 - r;

	double dist = distance(0,yx,xb,yb,0,y1);

	if(dist <= (double)(r) - 1e-8){
		cout<<-1<<endl;
	} else {
		double slope = -(double)(yx-1e-7 - yb)/xb;
		double ans = (((double)yw-r-yx+1e-7))/slope;
		cout.precision(30);
		cout<<ans<<endl;
	}
}


#include <iostream>
#include <set>
#include <string>
#include <vector>
#include <sstream>
#include <cmath>
#include <cstdio>
#include <list>
#include <algorithm>

using namespace std;

double distance(double ax,double ay,double bx,double by,double px,double py){
	double normalLength = sqrt((bx-ax)*(bx-ax) + (by-ay)*(by-ay));
	return ((double) abs((px-ax)*(by-ay) - (py-ay)*(bx-ax)))/normalLength;
}

int main()
{
	long y1x,y2x,yw,xb,yb,r;
	cin >> y1x >> y2x >> yw >> xb >> yb >> r;

	long y1 = yw + yw - y2x;
	long y2 = yw + yw - y1x;

	double yx = y2 - r-1e-6;

	double dist = distance(0,yx,xb,yb,0,y1);

	if(dist <= (double)(r) - 1e-8){
		cout<<-1<<endl;
	} else {
		double slope = -(double)(yx- yb)/xb;
		double ans = (((double)yw-r-yx))/slope;
		cout.precision(30);
		cout<<ans<<endl;
	}
}


#include <iostream>
#include <set>
#include <string>
#include <vector>
#include <sstream>
#include <cmath>
#include <cstdio>
#include <list>
#include <algorithm>

using namespace std;

double distance(double ax,double ay,double bx,double by,double px,double py){
	double normalLength = sqrt((bx-ax)*(bx-ax) + (by-ay)*(by-ay));
	return ((double) abs((px-ax)*(by-ay) - (py-ay)*(bx-ax)))/normalLength;
}

int main()
{
	long y1x,y2x,yw,xb,yb,r;
	cin >> y1x >> y2x >> yw >> xb >> yb >> r;

	long y1 = yw-r + yw-r - y2x;
	long y2 = yw-r + yw-r - y1x;

	double yx = y2 - r;

	double dist = distance(0,yx,xb,yb,0,y1);

	if(dist <= (double)(r)){
		cout<<-1<<endl;
	} else {
		double slope = -(double)(yx- yb)/xb;
		double ans = (((double)yw-r-yx))/slope;
		cout.precision(30);
		cout<<ans<<endl;
	}
}


#include <iostream>
#include <set>
#include <string>
#include <vector>
#include <sstream>
#include <cmath>
#include <cstdio>
#include <list>
#include <algorithm>

using namespace std;

double distance(long ax,long ay,long bx,long by,long px,long py){
	double normalLength = sqrt((bx-ax)*(bx-ax) + (by-ay)*(by-ay));
	return ((double) abs((px-ax)*(by-ay) - (py-ay)*(bx-ax)))/normalLength;
}

int main()
{
	long y1x,y2x,yw,xb,yb,r;
	cin >> y1x >> y2x >> yw >> xb >> yb >> r;

	long y1 = yw + yw - y2x;
	long y2 = yw + yw - y1x;

	long yx = y2 - r;

	double dist = distance(0,yx,xb,yb,0,y1);

	if(dist < (double)(r) + 1e-8){
		cout<<-1<<endl;
	} else {
		double slope = -(double)(yx - yb)/xb;
		double ans = ((double)(yw-yx))/slope;
		cout.precision(30);
		cout<<ans<<endl;
	}
}


#include <iostream>
#include <set>
#include <string>
#include <vector>
#include <sstream>
#include <cmath>
#include <cstdio>
#include <list>
#include <algorithm>

using namespace std;

double distance(long ax,long ay,long bx,long by,long px,long py){
	double normalLength = sqrt((bx-ax)*(bx-ax) + (by-ay)*(by-ay));
	return ((double) abs((px-ax)*(by-ay) - (py-ay)*(bx-ax)))/normalLength;
}

int main()
{
	long y1x,y2x,yw,xb,yb,r;
	cin >> y1x >> y2x >> yw >> xb >> yb >> r;

	long y1 = yw + yw - y2x;
	long y2 = yw + yw - y1x;

	long yx = y2 - r;

	double dist = distance(0,yx,xb,yb,0,y1);

	if(dist < r - 1e-8){
		cout<<-1<<endl;
	} else {
		double slope = (double)(yx - yb)/-xb;
		double ans = (yw-yx)/slope;
		cout.precision(30);
		cout<<ans<<endl;
	}
}


#include <iostream>
#include <set>
#include <string>
#include <vector>
#include <sstream>
#include <cmath>
#include <cstdio>
#include <list>
#include <algorithm>

using namespace std;

double distance(long ax,long ay,long bx,long by,long px,long py){
	double normalLength = sqrt((bx-ax)*(bx-ax) + (by-ay)*(by-ay));
	return ((double) abs((px-ax)*(by-ay) - (py-ay)*(bx-ax)))/normalLength;
}

int main()
{
	long y1x,y2x,yw,xb,yb,r;
	cin >> y1x >> y2x >> yw >> xb >> yb >> r;

	long y1 = yw + yw - y2x;
	long y2 = yw + yw - y1x;

	long yx = y2 - r;

	double dist = distance(0,yx,xb,yb,0,y1);

	if(dist < (double)(r) - 1e-8){
		cout<<-1<<endl;
	} else {
		double slope = -(double)(yx - yb)/xb;
		double ans = (((double)yw-r-yx))/slope;
		cout.precision(30);
		cout<<ans<<endl;
	}
}


#include <iostream>
#include <set>
#include <string>
#include <vector>
#include <sstream>
#include <cmath>
#include <cstdio>
#include <list>
#include <algorithm>

using namespace std;

double distance(long ax,long ay,long bx,long by,long px,long py){
	double normalLength = sqrt((bx-ax)*(bx-ax) + (by-ay)*(by-ay));
	return ((double) abs((px-ax)*(by-ay) - (py-ay)*(bx-ax)))/normalLength;
}

int main()
{
	long y1x,y2x,yw,xb,yb,r;
	cin >> y1x >> y2x >> yw >> xb >> yb >> r;

	long y1 = yw + yw - y2x;
	long y2 = yw + yw - y1x;

	long yx = y2 - r;

	double dist = distance(0,yx,xb,yb,0,y1);

	if(dist < (double)(r) + 1e-8){
		cout<<-1<<endl;
	} else {
		double slope = -(double)(yx - yb)/xb;
		double ans = ((double)(yw-r-yx))/slope;
		cout.precision(30);
		cout<<ans<<endl;
	}
}


#include <iostream>
#include <set>
#include <string>
#include <vector>
#include <sstream>
#include <cmath>
#include <cstdio>
#include <list>
#include <algorithm>

using namespace std;

double distance(double ax,double ay,double bx,double by,double px,double py){
	double normalLength = sqrt((bx-ax)*(bx-ax) + (by-ay)*(by-ay));
	return ((double) abs((px-ax)*(by-ay) - (py-ay)*(bx-ax)))/normalLength;
}

int main()
{
	long y1x,y2x,yw,xb,yb,r;
	cin >> y1x >> y2x >> yw >> xb >> yb >> r;

	long y1 = yw-r + yw-r - y2x;
	long y2 = yw-r + yw-r - y1x;

	double yx = y2 - r;

	double dist = distance(0,yx,xb,yb,0,y1);

	if(dist < (double)(r)){
		cout<<-1<<endl;
	} else {
		double slope = -(double)(yx- yb)/xb;
		double ans = (((double)yw-r-yx))/slope;
		cout.precision(30);
		cout<<ans<<endl;
	}
}


#include <iostream>
#include <set>
#include <string>
#include <vector>
#include <sstream>
#include <cmath>
#include <cstdio>
#include <list>
#include <algorithm>

using namespace std;

int main()
{
	long n,m;
	cin >> n >> m;
	long c[n];
	long mincol = 500000;
	for(long i = 0; i < n; i++){
		cin >> c[i];
		if(c[i] < mincol) mincol = c[i];
	}
	vector<set<long> > Q (100001);

	for(long i = 0; i < m; i++){
		long a,b;
		cin >> a >> b;
		if(c[a-1]!=c[b-1]){
			Q[c[a-1]].insert(c[b-1]);
			Q[c[b-1]].insert(c[a-1]);
		}
	}

	long ans = 0;
	long maxcol = Q[0].size();

	for(long i = 0; i < 100001; i++){
		if(Q[i].size() > maxcol){
			ans = i;
			maxcol = Q[i].size();
		}
	}
	if(maxcol>0)
		cout<<ans<<endl;
	else
		cout<<mincol<<endl;
}


#include <iostream>
#include <set>
#include <string>
#include <vector>
#include <sstream>
#include <cmath>
#include <cstdio>
#include <list>
#include <algorithm>

using namespace std;

double distance(long ax,long ay,long bx,long by,long px,long py){
	double normalLength = sqrt((bx-ax)*(bx-ax) + (by-ay)*(by-ay));
	return ((double) abs((px-ax)*(by-ay) - (py-ay)*(bx-ax)))/normalLength;
}

int main()
{
	long y1x,y2x,yw,xb,yb,r;
	cin >> y1x >> y2x >> yw >> xb >> yb >> r;

	long y1 = yw + yw - y2x;
	long y2 = yw + yw - y1x;

	long yx = y2 - r;

	double dist = distance(0,yx,xb,yb,0,y1);

	if(dist < (double)(r) - 1e-8){
		cout<<-1<<endl;
	} else {
		double slope = -(double)(yx -1e-8 - yb)/xb;
		double ans = (((double)yw-r-(yx-1e-8)))/slope;
		cout.precision(30);
		cout<<ans<<endl;
	}
}


#include <iostream>
#include <cmath>
#include <cstdio>

using namespace std;

int main(void) {
    double y1, y2, yw, xb, yb, r;
    double diam;

    cin >> y1 >> y2 >> yw >> xb >> yb >> r;

    yw -= r;

    double answ = -1;
    double end = xb;
    double beg = 0;
    while (abs(end - beg) > 10e-10) {
        double xw = (beg + end) / 2.0;
        double slope = (yw-yb)/(xb-xw);
        double h = yw - slope * xw;
        double xl = ((y2 - h) / slope)-r;
        if ((h+r) <= y2 && (h-r) >= y1 && xl > 0) {
            // cout << "h " << h << " slope " << slope << endl;
            answ = xw;
            break;
        } else if ((h+r) <= y1)
            end = xw;
        else
            beg = xw;
    }
    if (answ > 0)
        printf("%.10lf\n", answ);
    else cout << -1 << endl;

    return 0;
}


#include <iostream>
#include <cmath>
#include <cstdio>

using namespace std;

int main(void) {
    double y1, y2, yw, xb, yb, r;
    double diam;

    cin >> y1 >> y2 >> yw >> xb >> yb >> r;

    yw -= r;

    double answ = -1;
    double end = xb;
    double beg = 0;
    while (abs(end - beg) > 10e-10) {
        double xw = (beg + end) / 2.0;
        double slope = (yw-yb)/(xb-xw);
        double h = yw - slope * xw;
        double xl = ((y2 - h) / slope)-r;
        if ((h+r) < y2 && (h-r) > y1 && xl > 0) {
            // cout << "h " << h << " slope " << slope << endl;
            answ = xw;
            break;
        } else if ((h+r) <= y1)
            end = xw;
        else
            beg = xw;
    }
    if (answ > 0)
        printf("%.10lf\n", answ);
    else cout << -1 << endl;

    return 0;
}


#include <iostream>
#include <cmath>
#include <cstdio>

using namespace std;

int main(void) {
    double y1, y2, yw, xb, yb, r;
    double diam;

    cin >> y1 >> y2 >> yw >> xb >> yb >> r;

    yw -= r;

    double answ = -1;
    double end = xb;
    double beg = 0;

    // while (abs(end - beg) > 10e-10) {
    //  double xw = (beg + end) / 2.0;
    //  double slope = (yw-yb)/(xb-xw);
    //  double h = yw - slope * xw;
    //  double xl = ((y2 - h) / slope)-r;
    //  if ((h+r) <= y2 && (h-r) >= y1 && xl > 0) {
    //      // cout << "h " << h << " slope " << slope << endl;
    //      answ = xw;
    //      break;
    //  } else if ((h+r) <= y1)
    //      end = xw;
    //  else
    //      beg = xw;
    // }
    // if (answ > 0)
    //  printf("%.10lf\n", answ);
    // else cout << -1 << endl;

    answ = -1;
    end = xb;
    beg = 0;

    while (abs(end - beg) > 10e-10) {
        double xw = (beg + end) / 2.0;
        double slope = (yw-yb)/(xb-xw);
        double h = yw - slope * xw;
        double xl = ((y2 - h) / slope)-r;
        if ((h+r) <= y2 && (h-r) >= y1 && xl > 0) {
            end = xw;
            answ = xw;
        } else if ((h+r) <= y1)
            end = xw;
        else
            beg = xw;
    }

    double a1 = answ;

    answ = -1;
    end = xb;
    beg = 0;

    while (abs(end - beg) > 10e-10) {
        double xw = (beg + end) / 2.0;
        double slope = (yw-yb)/(xb-xw);
        double h = yw - slope * xw;
        double xl = ((y2 - h) / slope)-r;
        if ((h+r) <= y2 && (h-r) >= y1 && xl > 0) {
            beg = xw;
            answ = xw;
        } else if ((h+r) <= y1)
            end = xw;
        else
            beg = xw;
    }

    double a2 = answ;
    answ = (a1 + a2)/2;

    if (answ > 0)
        printf("%.10lf\n", answ);
    else cout << -1 << endl;

    return 0;
}


#include <iostream>
#include <cmath>
#include <cstdio>

using namespace std;

int main(void) {
    double y1, y2, yw, xb, yb, r;
    double diam;

    cin >> y1 >> y2 >> yw >> xb >> yb >> r;

    yw -= r;

    double answ = -1;
    double end = xb;
    double beg = 0;
    while (abs(end - beg) > 10e-10) {
        double xw = (beg + end) / 2.0;
        double slope = (yw-yb)/(xb-xw);
        double h = yw - slope * xw;
        double xl = ((y2 - h) / slope)-r;
        if ((h-r) < y2 && (h+r) > y1 && xl > 0) {
            cout << "h " << h << " slope " << slope << endl;
            answ = xw;
            break;
        } else if ((h+r) <= y1)
            end = xw;
        else
            beg = xw;
    }
    if (answ > 0)
        printf("%.10lf\n", answ);
    else cout << -1 << endl;

    return 0;
}


#include <iostream>
#include <cmath>
#include <cstdio>

using namespace std;

int main(void) {
    double y1, y2, yw, xb, yb, r;
    double diam;

    cin >> y1 >> y2 >> yw >> xb >> yb >> r;

    yw -= r;

    double answ = -1;
    double end = xb;
    double beg = 0;

    while (abs(end - beg) > 10e-10) {
        double xw = (beg + end) / 2.0;
        double slope = (yw-yb)/(xb-xw);
        double h = yw - slope * xw;
        double xl = ((y2 - h) / slope)-r;
        if ((h+r) <= y2 && (h-r) >= y1 && xl > 0) {
            beg = xw;
            answ = xw;
            // break;
        } else if ((h-r) <= y1)
            end = xw;
        else
            beg = xw;
    }
    if (answ > 0)
        printf("%.10lf\n", answ);
    else cout << -1 << endl;

    // answ = -1;
    // end = xb;
    // beg = 0;

    // while (abs(end - beg) > 10e-10) {
    //  double xw = (beg + end) / 2.0;
    //  double slope = (yw-yb)/(xb-xw);
    //  double h = yw - slope * xw;
    //  double xl = ((y2 - h) / slope)-r;
    //  if ((h+r) <= y2 && (h-r) >= y1 && xl >= 0) {
    //      end = xw;
    //      answ = xw;
    //  } else if ((h-r) <= y1)
    //      end = xw;
    //  else
    //      beg = xw;
    // }

    // double a1 = answ;

    // answ = -1;
    // end = xb;
    // beg = 0;

    // while (abs(end - beg) > 10e-10) {
    //  double xw = (beg + end) / 2.0;
    //  double slope = (yw-yb)/(xb-xw);
    //  double h = yw - slope * xw;
    //  double xl = ((y2 - h) / slope)-r;
    //  if ((h+r) <= y2 && (h-r) >= y1 && xl >= 0) {
    //      beg = xw;
    //      answ = xw;
    //  } else if ((h-r) <= y1)
    //      end = xw;
    //  else
    //      beg = xw;
    // }

    // double a2 = answ;
    // answ = (a1 + a2)/2;

    // if (answ > 0)
    //  printf("%.10lf\n", answ);
    // else cout << -1 << endl;

    return 0;
}


#include <iostream>
#include <cmath>
#include <cstdio>

using namespace std;

int main(void) {
    double y1, y2, yw, xb, yb, r;
    double diam;

    cin >> y1 >> y2 >> yw >> xb >> yb >> r;

    yw -= r;

    double answ = -1;
    double end = xb;
    double beg = 0;

    while (abs(end - beg) > 10e-10) {
        double xw = (beg + end) / 2.0;
        double slope = (yw-yb)/(xb-xw);
        double h = yw - slope * xw;

        double xl = ((y2 - h) / slope)-r; // xl > 0

        // double hc = h - (-r) * slope; // hc <= y2

        double dist = sqrt(pow(xw,2) + pow(y2-yw,2));

        if ((h+r) <= y2 && (h-r) >= y1 && xl > 0 && dist > r) {
            beg = xw;
            answ = xw;
            // break;
        } else if ((h-r) <= y1)
            end = xw;
        else
            beg = xw;
    }
    if (answ > 0)
        printf("%.10lf\n", answ);
    else cout << -1 << endl;

    // answ = -1;
    // end = xb;
    // beg = 0;

    // while (abs(end - beg) > 10e-10) {
    //  double xw = (beg + end) / 2.0;
    //  double slope = (yw-yb)/(xb-xw);
    //  double h = yw - slope * xw;
    //  double xl = ((y2 - h) / slope)-r;
    //  if ((h+r) <= y2 && (h-r) >= y1 && xl >= 0) {
    //      end = xw;
    //      answ = xw;
    //  } else if ((h-r) <= y1)
    //      end = xw;
    //  else
    //      beg = xw;
    // }

    // double a1 = answ;

    // answ = -1;
    // end = xb;
    // beg = 0;

    // while (abs(end - beg) > 10e-10) {
    //  double xw = (beg + end) / 2.0;
    //  double slope = (yw-yb)/(xb-xw);
    //  double h = yw - slope * xw;
    //  double xl = ((y2 - h) / slope)-r;
    //  if ((h+r) <= y2 && (h-r) >= y1 && xl >= 0) {
    //      beg = xw;
    //      answ = xw;
    //  } else if ((h-r) <= y1)
    //      end = xw;
    //  else
    //      beg = xw;
    // }

    // double a2 = answ;
    // answ = (a1 + a2)/2;

    // if (answ > 0)
    //  printf("%.10lf\n", answ);
    // else cout << -1 << endl;

    return 0;
}


#include <iostream>
#include <cmath>
#include <cstdio>

using namespace std;

int main(void) {
    double y1, y2, yw, xb, yb, r;
    double diam;

    cin >> y1 >> y2 >> yw >> xb >> yb >> r;

    yw -= r;

    double answ = -1;
    double end = xb;
    double beg = 0;

    // while (abs(end - beg) > 10e-10) {
    //  double xw = (beg + end) / 2.0;
    //  double slope = (yw-yb)/(xb-xw);
    //  double h = yw - slope * xw;
    //  double xl = ((y2 - h) / slope)-r;
    //  if ((h+r) <= y2 && (h-r) >= y1 && xl > 0) {
    //      answ = xw;
    //      break;
    //  } else if ((h-r) <= y1)
    //      end = xw;
    //  else
    //      beg = xw;
    // }
    // if (answ > 0)
    //  printf("%.10lf\n", answ);
    // else cout << -1 << endl;

    answ = -1;
    end = xb;
    beg = 0;

    while (abs(end - beg) > 10e-10) {
        double xw = (beg + end) / 2.0;
        double slope = (yw-yb)/(xb-xw);
        double h = yw - slope * xw;
        double xl = ((y2 - h) / slope)-r;
        if ((h+r) <= y2 && (h-r) >= y1 && xl >= 0) {
            end = xw;
            answ = xw;
        } else if ((h-r) <= y1)
            end = xw;
        else
            beg = xw;
    }

    double a1 = answ;

    answ = -1;
    end = xb;
    beg = 0;

    while (abs(end - beg) > 10e-10) {
        double xw = (beg + end) / 2.0;
        double slope = (yw-yb)/(xb-xw);
        double h = yw - slope * xw;
        double xl = ((y2 - h) / slope)-r;
        if ((h+r) <= y2 && (h-r) >= y1 && xl >= 0) {
            beg = xw;
            answ = xw;
        } else if ((h-r) <= y1)
            end = xw;
        else
            beg = xw;
    }

    double a2 = answ;
    answ = (a1 + a2)/2;

    if (answ > 0)
        printf("%.10lf\n", answ);
    else cout << -1 << endl;

    return 0;
}


#include <iostream>
#include <cmath>
#include <cstdio>

using namespace std;

int main(void) {
    double y1, y2, yw, xb, yb, r;
    double diam;

    cin >> y1 >> y2 >> yw >> xb >> yb >> r;

    yw -= r;

    double answ = -1;
    double end = xb;
    double beg = 0;
    while (abs(end - beg) > 10e-10) {
        double xw = (beg + end) / 2.0;
        double slope = (yw-yb)/(xb-xw);
        double h = yw - slope * xw;
        double xl = ((y2 - h) / slope)-r;
        if ((h-r) < y2 && (h+r) > y1 && xl > 0) {
            // cout << "h " << h << " slope " << slope << endl;
            answ = xw;
            break;
        } else if ((h+r) <= y1)
            end = xw;
        else
            beg = xw;
    }
    if (answ > 0)
        printf("%.10lf\n", answ);
    else cout << -1 << endl;

    return 0;
}


#include <iostream>
#include <cmath>
#include <cstdio>

using namespace std;

int main(void) {
    double y1, y2, yw, xb, yb, r;
    double diam;

    cin >> y1 >> y2 >> yw >> xb >> yb >> r;

    yw -= r;

    double answ = -1;
    double end = xb;
    double beg = 0;

    while (abs(end - beg) > 10e-10) {
        double xw = (beg + end) / 2.0;
        double slope = (yw-yb)/(xb-xw);
        double h = yw - slope * xw;

        double xl = ((y2 - h) / slope)-r; // xl > 0

        double a = abs(-xw * (y2 - h));
        double c = sqrt(xw*xw + pow(yw - h, 2));
        bool check = a / c > r;

        // double hc = h - (-r) * slope; // hc <= y2

        // double dist = sqrt(pow(xw,2) + pow(y2-yw,2));

        if ((h+r) <= y2 && (h-r) >= y1 && xl > 0 && check) {
            beg = xw;
            answ = xw;
            // break;
        } else if ((h-r) <= y1)
            end = xw;
        else
            beg = xw;
    }
    if (answ > 0)
        printf("%.10lf\n", answ);
    else cout << -1 << endl;

    // answ = -1;
    // end = xb;
    // beg = 0;

    // while (abs(end - beg) > 10e-10) {
    //  double xw = (beg + end) / 2.0;
    //  double slope = (yw-yb)/(xb-xw);
    //  double h = yw - slope * xw;
    //  double xl = ((y2 - h) / slope)-r;
    //  if ((h+r) <= y2 && (h-r) >= y1 && xl >= 0) {
    //      end = xw;
    //      answ = xw;
    //  } else if ((h-r) <= y1)
    //      end = xw;
    //  else
    //      beg = xw;
    // }

    // double a1 = answ;

    // answ = -1;
    // end = xb;
    // beg = 0;

    // while (abs(end - beg) > 10e-10) {
    //  double xw = (beg + end) / 2.0;
    //  double slope = (yw-yb)/(xb-xw);
    //  double h = yw - slope * xw;
    //  double xl = ((y2 - h) / slope)-r;
    //  if ((h+r) <= y2 && (h-r) >= y1 && xl >= 0) {
    //      beg = xw;
    //      answ = xw;
    //  } else if ((h-r) <= y1)
    //      end = xw;
    //  else
    //      beg = xw;
    // }

    // double a2 = answ;
    // answ = (a1 + a2)/2;

    // if (answ > 0)
    //  printf("%.10lf\n", answ);
    // else cout << -1 << endl;

    return 0;
}


#include <iostream>
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#define inf 1000000000
using namespace std;
long double y1,y2,yw,xb,yb,r;
int main()
{
    cin>>y1>>y2>>yw;
    cin>>xb>>yb>>r;
    long double rr=xb-0.1;
    long double ll=0.10000000;
    long double re;
    long double tg;
    while(rr-ll>0.00000000001)
    {
        re=(rr+ll)/2.000000000;
        tg=(xb-re)/(yw-yb-r);
        if(yw-re/tg>=y2-0.000000001)
            ll=re;
        else
            rr=re;
    }
    tg=(xb-rr)/(yw-yb-r);
    if(yw-rr/tg-r<y2-r-0.000000001 && yw-rr/tg-r>y1+r+0.000000001)
        cout<<setprecision(20)<<rr<<endl;
    else
        cout<<"-1"<<endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#define inf 1000000000
using namespace std;
long double y1,y2,yw,xb,yb,r;
int main()
{
    cin>>y1>>y2>>yw;
    cin>>xb>>yb>>r;
    long double rr=xb-0.1;
    long double ll=1.0000000;
    long double re;
    long double tg;
    while(rr-ll>0.000000001)
    {
        re=(rr+ll)/2.000000000;
        tg=(xb-re)/(yw-yb-r);
        if(yw-re/tg-r>y1+r+0.000000001)
            ll=re;
        else
            rr=re;
    }
    tg=(xb-ll)/(yw-yb-r);
    if(yw-ll/tg-r<y2-r-0.000000001 && yw-ll/tg-r>y1+r+0.000000001 && ll-(yw-r-y2)*tg>r+0.000000001)
        cout<<setprecision(20)<<ll<<endl;
    else
        cout<<"-1"<<endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#define inf 1000000000
using namespace std;
long double yy1,yy2,yw,xb,yb,r;
int main()
{
    cin>>yy1>>yy2>>yw;
    cin>>xb>>yb>>r;
    long double rr=xb-0.1;
    long double ll=1.0000000;
    long double re;
    long double tg;
    while(rr-ll>0.000000001)
    {
        re=(rr+ll)/2.000000000;
        tg=(xb-re)/(yw-yb-r);
        if(yw-re/tg-r>yy1+r+0.000000001)
            ll=re;
        else
            rr=re;
    }
    tg=(xb-ll)/(yw-yb-r);
    long double xx=ll-(yw-r-yy2)*tg;
    long double dist=(yy2-(yw-ll/tg-r))*xx/sqrt(xx*xx+(yy2-(yw-ll/tg-r))*(yy2-(yw-ll/tg-r)));
  //  cout<<(yy2-(yw-ll/tg-r))*xx<<" "<<sqrt(xx*xx+(yy2-(yw-ll/tg-r))*(yy2-(yw-ll/tg-r)))<<" "<<xx<<" "<<dist<<endl;
    if(yw-ll/tg-r<yy2-r-0.000000001 && yw-ll/tg-r>yy1+r+0.000000001 && dist>r+0.000000001)
        cout<<setprecision(20)<<ll<<endl;
    else
        cout<<"-1"<<endl;
    return 0;
}
// 4 9 30 3 3 1


#include <iostream>
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#define inf 1000000000
using namespace std;
long double yy1,yy2,yw,xb,yb,r;
int main()
{
    cin>>yy1>>yy2>>yw;
    cin>>xb>>yb>>r;
    long double rr=xb-0.1;
    long double ll=1.0000000;
    long double re;
    long double tg;
    while(rr-ll>0.000000001)
    {
        re=(rr+ll)/2.000000000;
        tg=(xb-re)/(yw-yb-r);
        if(yw-re/tg-r>yy1+r+0.000000001)
            ll=re;
        else
            rr=re;
    }
    tg=(xb-ll)/(yw-yb-r);
    long double xx=(yw-r-yy2)*tg;
    long double dist=(yy2-yy1)*xx/sqrt(xx*xx+(yy2-yy1)*(yy2-yy1));
    if(yw-ll/tg-r<yy2-r-0.000000001 && yw-ll/tg-r>yy1+r+0.000000001 && dist>r+0.000000001)
        cout<<setprecision(20)<<ll<<endl;
    else
        cout<<"-1"<<endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#define inf 1000000000
using namespace std;
long double yy1,yy2,yw,xb,yb,r;
long double modul(long double x)
{
    if(x<0)
        return -x;
    return x;
}
long double f(long double x1,long double x2,long double y1,long double y2,long double x3,long double y3)
{

    return (y3-y1)*x2/1.0/sqrt((y3-y1)*(y3-y1)+(x2*x2));
}
int main()
{
    cin>>yy1>>yy2>>yw;
    cin>>xb>>yb>>r;
    long double rr=xb-0.1;
    long double ll=1.0000000;
    long double re;
    long double tg;
    while(rr-ll>0.000000001)
    {
        re=(rr+ll)/2.000000000;
        tg=(xb-re)/(yw-yb-r);
        if(yw-re/tg-r>yy1+r+0.000000001)
            ll=re;
        else
            rr=re;
    }
    tg=(xb-ll)/(yw-yb-r);
    if(yw-ll/tg-r<yy2-r-0.000000001 && yw-ll/tg-r>yy1+r+0.000000001 && f(0,ll-(yw-r-yy2)/tg,yy2,yy2,0,yy1+r)>r+0.000000001)
        cout<<setprecision(20)<<ll<<endl;
    else
        cout<<"-1"<<endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#define inf 1000000000
using namespace std;
long double yy1,yy2,yw,xb,yb,r;
int main()
{
    cin>>yy1>>yy2>>yw;
    cin>>xb>>yb>>r;
    long double rr=xb-0.1;
    long double ll=1.0000000;
    long double re;
    long double tg;
    while(rr-ll>0.000000001)
    {
        re=(rr+ll)/2.000000000;
        tg=(xb-re)/(yw-yb-r);
        if(yw-re/tg-r>yy1+r+0.000000001)
            ll=re;
        else
            rr=re;
    }
    tg=(xb-ll)/(yw-yb-r);
    long double xx=(yw-r-yy2)*tg;
    long double dist=(yy2-(yw-ll/tg-r))*xx/sqrt(xx*xx+(yy2-(yw-ll/tg-r))*(yy2-(yw-ll/tg-r)));
    if(yw-ll/tg-r<yy2-r-0.000000001 && yw-ll/tg-r>yy1+r+0.000000001 && dist>r+0.000000001)
        cout<<setprecision(20)<<ll<<endl;
    else
        cout<<"-1"<<endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#define inf 1000000000
using namespace std;
long double y1,y2,yw,xb,yb,r;
int main()
{
    cin>>y1>>y2>>yw;
    cin>>xb>>yb>>r;
    long double rr=xb-0.1;
    long double ll=0.10000000;
    long double re;
    long double tg;
    while(rr-ll>0.00000000001)
    {
        re=(rr+ll)/2.000000000;
        tg=(xb-re)/(yw-yb-r);
        if(yw-re/tg-r>(y2+y1)/2.000000)
            ll=re;
        else
            rr=re;
    }
    tg=(xb-rr)/(yw-yb-r);
    if(yw-rr/tg-r<y2-r-0.000000001 && yw-rr/tg-r>y1+r+0.000000001)
        cout<<setprecision(20)<<rr<<endl;
    else
        cout<<"-1"<<endl;
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main()
{
    double y1, y2, yw, xb, yb, r, xw;
    double i, j, m, n, k;
    while( cin>>y1>>y2>>yw>>xb>>yb>>r )
    {
        m = y1 + r;
        yb = 2*(yw-yb) + yb;
        if( y2-y1 > 2*r )
        {
            k = (yb - m)/xb;
            n = fabs(y2-m)/sqrt(1+k*k);
            if( n >= r )
            printf( "%.10lf\n",(yw - m)/k );
            else printf("-1\n");
        }
        else printf("-1\n");
    }
}


#include <iostream>

using namespace std;

int main()
{
	int n,a,b,c;

	cin >> n >> a >> b >> c;

	int z = 0;

	for(int d = 0; d <= n; d++)
	{
	if(a + b + c >= 2)
	{
		z += 1;
	}
  }

	cout << z;

	return 0;
}


#include <iostream>

using namespace std;

int main()
{
	int a,b,c;

	cin >> a >> b >> c;

	int d = 0;

	if(a + b + c >= 2)
	{
		d += 1;
	}

	cout << d;

	return 0;
}


#include <iostream>

using namespace std;

int main()
{
	int n,a,b,c;

	cin >> n >> a >> b >> c;

	int z = 0;

	for(int d = 1; d <= n; d++)
	{
	if(a + b + c >= 2)
	{
		z++;
	}
  }

	cout << z;

	return 0;
}


#include <iostream>

using namespace std;

int main()
{
	int n,a,b,c;

	cin >> n >> a >> b >> c;

	int z = 0;

	for(int d = 1; d <= n; d++)
	{
	if(a + b + c >= 2)
	{
		z += 1;
	}
  }

	cout << z;

	return 0;
}


#include <iostream>

using namespace std;

int main()
{
	int a,b,c;

	cin >> a >> b >> c;

	int d = 0;

	if(a + b + c >= 2)
	{
		d += 1;
	}

	cout << d;

}


#include <iostream>

using namespace std;

int main()
{
	int n,a,b,c;

	cin >> n;

	int z = 0;

	for(int d = 1; d <= n; d++)
	{
		cin>>a>>b>>c;
	if(a + b + c >= 2)
	{
		z++;
	}
  }

	cout << z;

	return 0;
}


#include <iostream>

using namespace std;

int main()
{
	int n,a,b,c;

	cin >> n >> a >> b >> c;

	int s = 0;

	for(int d = 0; d <= n; d++)
	{
	if(a + b + c >= 2)
	{
		s += 1;
	}
  }

	cout << s;

	return 0;
}


#include <iostream>

using namespace std;

int main()
{
	int a,b,c;

	cin >> a >> b >> c;

	int d = 0;

	if(a + b + c >= 2)
	{
		d += 1;
	}

	cout << c;

	return 0;
}


#include <iostream>
using namespase std;

int main(){
                        cin >> n;
                        cin >> sol[n][3];
                        int s = 0;
                        for (int i = 0; i < 0; i ++){
                                                if (sol[i][0]+ sol[i][1] + sol[i][2] > 1){s++;}
                        }
                        cout << s;
                        return 0;
}


#include <iostream>
using namespace std;

int main(){
                        cin >> n, r1, r2, r3;
                        int s = 0;
                        for (int j = 0; j < n; j++;){
                            cin >> r1 >> r2 >> r3;
                            if (r1+r2+r3 > 1){s++;}
                        }
                        cout << s;
                        return 0;


#include <iostream>
using namespace std;

int main(){
                        int n, r1, r2, r3;
                        sin >> n;
                        int s = 0;
                        for (int j = 0; j < n; j++;){
                            cin >> r1 >> r2 >> r3;
                            if (r1+r2+r3 > 1){s++;}
                        }
                        cout << s;
                        return 0;
}


#include <iostream>
using namespace std;

int main(){
                        int n, r1, r2, r3;
                        cin >> n;
                        int s = 0;
                        for (int j = 0; j < n; j++;){
                            cin >> r1 >> r2 >> r3;
                            if (r1+r2+r3 > 1){s++;}
                        }
                        cout << s;
                        return 0;
}


#include <iostream>
using namespace std;

int main(){
                        int n, r1, r2, r3;
                        cin >> n;
                        int s = 0;
                        for (int j = 0; j < n; j++){
                            cin >> r1 >> r2 >> r3;
                            if (r1+r2+r3 > 1){s++;}
                        }
                        cout << s;
                        return 0;
}


#include <iostream>
using namespase std;

int main(){
                        cin << n;
                        cin << sol[n][3];
                        int s = 0;
                        for (int i = 0; i < 0; i ++){
                                                if (sol[i][0]+ sol[i][1] + sol[i][2] > 1){s++;}
                        }
                        cout >> s;
                        return 0;
}


#include <iostream>
#include <cstdlib>
using namespase std;

int main(){
                        cin >> n;
                        int sol[n][3]
                        for (int j = 0; j < n; j++;){
                            cin >> sol[j]
                        int s = 0;
                        for (int i = 0; i < n; i++;){
                                                if (sol[i][0]+ sol[i][1] + sol[i][2] > 1){s++;}
                        }
                        cout << s;
                        return 0;
}


#include <iostream>

using namespace std;

int main()
{
   int n, ans = 0;
   cin >> n;

   for(int i = 0; i<n; i++){
        int x, y ,z; cin >> x >> y >> z;
        ans += (x+y+z>=2);
   };

   cout << ans << endl;
} ;


int main()
{
   int n, ans = 0;
   cin>>n;

   for(int i = 0; i<n; i++){
        int x, y ,z; cin >> x >> y >> z;
        ans += (x+y+z>=2);
   };

   cout<< ans <<endl;
} ;


int main()
{
   int n, ans = 0;
   cin >> n;

   for(int i = 0; i<n; i++){
        int x, y ,z; cin >> x >> y >> z;
        ans += (x+y+z>=2);
   };

   cout << ans << endl;

}


int main()
{
   int n, ans = 0;
   cin >> n;

   for(int i = 0; i<n; i++){
        int x, y ,z; cin >> x >> y >> z;
        ans += (x+y+z>=2);
   };

   cout << ans;

}


int main()
{
   int n, ans = 0;
   cin >> n;

   for(int i = 0; i<n; i++){
        int x, y ,z; cin >> x >> y >> z;
        ans += (x+y+z>=2);
   };

   cout << ans << endl;
} ;


#include <iostream>

using namespace std;

int main()
{
   int n, ans = 0;
   cin >> n;

   for(int i = 0; i<n; i++){
        int x, y ,z; cin >> x >> y >> z;
        ans += (x+y+z>=2);
   };

   cout< < ans << endl;
} ;


int main()
{
   int n, ans = 0;
   cin >> n;

   for(int i = 0; i<n; i++){
        int x, y ,z; cin >> x >> y >> z;
        ans += (x+y+z>=2);
   };

   cout << ans << endl;
    return 0
}


#include<iostream>
#include<string>
using namespace std;
int main()
{
	string s;
	int n;
	cin >> n;
	int counter = 0, answer = 0;
	for (int i = 0; i < n; i++){

		cin >> s;
		for (int j = 0; j < 3; j++){
			if (s[j] == '1'){
				counter++;
			}

		}
		if (counter >= 2){
			answer++;
		}
		counter = 0;
	}
	cout << answer << endl;
}


#include<iostream>
#include<string>
using namespace std;
int main()
{
	string s;
	short n;
	cin >> n;
	short counter = 0, answer = 0;
	for (int i = 0; i < n; i++){

		cin >> s;
		for (int j = 0; j < 3; j++){
			if (s[j] == '1'){
				counter++;
			}

		}
		if (counter >= 2){
			answer++;
		}
		counter = 0;
	}
	cout << answer << endl;
}


#include<iostream>
#include<string>
using namespace std;
int main()
{

	int n;
	cin >> n;
	long long counter = 0, answer = 0;
	for (int i = 0; i < n; i++){
		string s;
		cin >> s;
		for (int j = 0; j < 3; j++){
			if (s[j] == '1'){
				counter++;
			}

		}
		if (counter >= 2){
			answer++;
		}
		counter = 0;
	}
	cout << answer << endl;
}


include<iostream>
#include<string>
using namespace std;
int main()
{
short n;
cin >> n;
short counter = 0, answer = 0;
for (int i = 0; i < n; i++){
	counter = 0;

	for (int j = 0; j < 3; j++){

		int a;
		cin >> a;
		if (a == 1){
			counter++;
		}

	}
	if (counter >= 2){
		answer++;
	}
	counter = 0;
}
cout << answer << endl;
return 0;
}


#include<iostream>
#include<string>
using namespace std;
int main()
{
	int n, arr[3], count_1 = 0, count_res = 0;
	cin >> n;
	for (int j = 0; j < n; j++){
		for (int i = 0; i < 3; i++){
			cin >> arr[i];
			if (arr[i] == 1){
				count_1++;
			}
		}
		if (count_1 >= 2){
			count_res++;
		}
		count_1 = 0;
	}
	cout << count_res << endl;

	return 0;
}


#include<iostream>
#include<string>
using namespace std;
int main()
{

short n;
cin >> n;
short counter = 0, answer = 0;
for (int i = 0; i < n; i++){
	counter = 0;

	for (int j = 0; j < 3; j++){

		int a;
		cin >> a;
		if (a == 1){
			counter++;
		}

	}
	if (counter >= 2){
		answer++;
	}
	counter = 0;
}
cout << answer << endl;
return 0;
}


#include<iostream>
#include<string>
using namespace std;
int main()
{

	short n;
	cin >> n;
	double counter = 0, answer = 0;
	for (int i = 0; i < n; i++){
		string s;
		cin >> s;
		for (int j = 0; j < 3; j++){
			if (s[j] == '1'){
				counter++;
			}

		}
		if (counter >= 2){
			answer++;
		}
		counter = 0;
	}
	cout << answer << endl;
}


#include<iostream>
#include<string>
using namespace std;
int main()
{

	short n;
	cin >> n;
	short counter = 0, answer = 0;
	for (int i = 0; i < n; i++){
		string s;
		cin >> s;
		for (int j = 0; j < 3; j++){
			if (s[j] == '1'){
				counter++;
			}

		}
		if (counter >= 2){
			answer++;
		}
		counter = 0;
	}
	cout << answer << endl;
}


#include<iostream>
#include<string>
using namespace std;
int main()
{

	int n;
	cin >> n;
	short counter = 0, answer = 0;
	for (int i = 0; i < n; i++){
		string s;
		cin >> s;
		for (int j = 0; j < 3; j++){
			if (s[j] == '1'){
				counter++;
			}

		}
		if (counter >= 2){
			answer++;
		}
		counter = 0;
	}
	cout << answer << endl;
}


#include <bits/stdc++.h>

using namespace std;

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

  int p, v, t;
  int count;

  for (int i = 0; i < n; i++) {
  	cin << p << v << t;
  	if (p + v + t > 2) count++;
  }

  cout << count << endl;
}


// https://codeforces.com/problemset/problem/231/A

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

void solve() {
  int n; cin >> n;

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

    if (x+y+z >= 2) {
      ++cnt;
    }
  }

  cout << cnt << endl;
}

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);

  solve();

  return 0;
}


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

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);

  int n; cin >> n;

  int cnt = 0;
  while (n--) {
    int a, b, c;
    cin >> a >> b >> c;

    int sum = a + b + c;
    (sum >= 2 ? cnt++ : cnt);
  }

  cout << cnt << endl;

  return 0;
}


#include <bits/stdc++.h>

using namespace std;

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

  int p, v, t;
  int count = 0;

  for (int i = 0; i < n; i++) {
  	cin >> p >> v >> t;
  	if (p + v + t >= 2) count++;
  }

  cout << count << endl;
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

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

  int p, v, t;
  int count;

  for (int i = 0; i < n; i++) {
  	cin >> p >> v >> t;
  	if (p + v + t >= 2) count++;
  }

  cout << count << endl;
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

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

  int p, v, t;
  int count;

  for (int i = 0; i < n; i++) {
  	cin >> p >> v >> t;
  	if (p + v + t >= 2) count++;
  }

  cout << count << endl;
}


#include <bits/stdc++.h>

using namespace std;

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

  int p = 0, v = 0, t = 0;
  int count = 0;

  for (int i = 0; i < n; i++) {
  	cin >> p >> v >> t;
  	if (p + v + t >= 2) count++;
  }

  cout << count << endl;
  return 0;
}


// https://codeforces.com/problemset/problem/231/A

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

void solve() {
  int n; cin >> n;

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

    if (x+y+z >= 2) {
      ++cnt;
    }
  }

  cout << cnt << endl;
}

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);

  solve();

  return 0;
}


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

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);

  int n; cin >> n;

  int cnt = 0;
  while (n--) {
    int a, b, c;
    cin >> a >> b >> c;

    int sum = a + b + c;
    if (sum >= 2) cnt++;
  }

  cout << cnt << endl;

  return 0;
}


#include<iostream>
using namespace std;
int main(){
    int n,h=0,sum=0,a[3];
    cin>>n;
    while (n>0){
        for(int s=0;s<3;s++){
        cin>>a[s];
        }
        for(int s=0;s<3;s++){
            sum=sum+=a[s];
            if(sum==2 || sum==3)
            h++;
            sum=0;
            n--;
        }
        cout<<h<<endl;
            return 0;
    }


#include<iostream>
using namespacw std;
int main(){
    int n,h=0,sum=0,a[3];
    cin>>n;
    while(n>0){
        for(int s=0 ; s<3 ; s++)
        {
        cin>>a[v];
        }
        for(int s=0 ; s<3 ; s++)
        {
        sum=sum+a[v];
        }
        if(sum==2 || sum==3)
        h++;
        n--;
    }
        cout<<h<<endl;
    return 0
}


#include<iostream>
using namespace std;
int main(){
    int x , l=0 , sum=0 , n[3];
    while(x>0){
    for(int s=0 ; s<3 ; s++){
    cin>>n[v];
    }
    for(int s=0 ; s<3 ; s++){
        sum=sum+n[v]
        if(sum<2)
        cout<<x;
        else
        cout<<sum;
    }
    return 0;
}


#include<iostream>
using namespace std;
int main(){
    int x , l=0 , sum=0 , n[3];
    while  (x>0){
    for(int s=0 ; s<3 ; s++){
    cin>>n[v];
    }
    for(int s=0 ; s<3 ; s++){
        sum=sum+n[v]
        if(sum==2)||(sum==3)
        cout<<x;
        else
        cout<<0;
    }
    return 0;
}


#include<iostream>
using namespace std;
int main(){
    int x , l=0 , sum=0 , n[3];
    if(x>0)
    for(int s=0 ; s<3 ; s++){
    cin>>n[3]
    }
    for(int s=0 ; s<3 ; s++){
        sum=sum+n[3]
        if(sum<2)
        cout<<0;
        else<<x;
    }
    return 0;
}


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

int main(){

    int x,h=0,sum=0, n[3];
cin>>x;
    while (x>0){
        for(int s=0 ; s<3 ; s++){
        cin>>n[s];
        }
        for( int s=0 ; s<3 ; s++){
            sum =sum+=n[s];
        }
            if(sum==2 || sum==3)h++;
            sum==0;
            x--;
    }
            cout<<x<<end l;
            return 0;
}


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

int main(){
    int z,h=0,sum=0, n[3];
    while x>3{
        for(int s=0 ; s<3 ; s++){
        cin>>n[v];

        }
        for( int s=0 ,s<3 ; s++){
            sum =sum+=n[v];
            if(sum==2)||(sum==3)
            sum==0;
            x--;
            cout<<x;
            return 0;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int x,h=0,sum=0,n[3];
    while (x>0){
        for(int s=0 ; s<3 ; s++){
        cin>>n[v];
        }
        for(int s=0 ; s<3 ; s++){
            sum=sum+n[v];
if(sum==2 || sum==3)h++
sum==0;
x--;
cout<<x;

    return 0;

        }
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int x,h=0,sum=0,n[3];
    while (x>0){
        for(int s=0 ; s<3 ; s++){
        cin>>n[v];}
        for(int s=0 ; s<3 ; s++){
            sum=sum+n[v];
if(sum==2 || sum==3)
cout<<x;
else
cout<<sum;
    }
    return 0;
}


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

int main(){
    int z,h=0,sum=0, n[3];
    while (x>0){
        cin>>b;
        for(int s=0 ; s<3 ; s++){
        cin>>n[v];
        }
        for( int s=0 ,s<3 ; s++){
            sum =sum+=n[v];
            if(sum==2)||(sum==3)h++;
            sum==0;
            x--;
            cout<<x<<end l;
            return 0;
    }
}


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

int main(){
    int z,h=0,sum=0, n[3];
    cin>>h;
    while (x>0){
        for(int s=0 ; s<3 ; s++){
        cin>>n[v];
        }
        for( int s=0 ,s<3 ; s++){
            sum =sum+=n[v];
            if(sum==2)||(sum==3)h++;
            sum==0;
            x--;
            cout<<x<<end l;
            return 0;
    }
}


#include<iostream>
using namespace std;
int main(){
    int x , l=0 , sum=0 , n[3];
    if(x>0)
    for(int s=0 ; s<3 ; s++){
    cin>>n[3];
    }
    for(int s=0 ; s<3 ; s++){
        sum=sum+n[3]
        if(sum==2)||(sum==3)
        cout<<x;
        else
        cout<<0;
    }
    return 0;
}


#include<iostream>
using namespace std;
int main(){
    int g=0,h,b[2];
    if(h!=0)
    for(int l=0 , l<1 , l++){
    cout<<0;
    }
    for(int l=0 , l<3 , l++){
        cout<<h;
    }
    return 0;
}


#include<iostream>
using namespacw std;
int main(){
    int n,h=0,sum=0,a[3];
    cin>>n;
    while(n>0){
        for(int s=0 ; s<3 ; s++)
        {
        cin>>a[3];
        }
        for(int s=0 ; s<3 ; s++)
        {
        sum=sum+a[3];
        }
        if(sum==2 || sum==3)
        h++;
        sum==0;
        n--;
    }
        cout<<h<<endl;
    return 0
}


#include<iostream>
using namespace std;
int main(){
    int n,h=0,sum=0,a[3];
    cin>>n;
    while (n>0){
        for(int s=0 ; s<3 ; s++){
        cin>>a[s];
        }
        for(int s=0 ; s<3 ; s++){
            sum=sum+=a[s];
            if(sum==2 || sum==3)
            h++;
            sum==0;
            n--;
        }
            return 0;
    }


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

int main() {

int x,h=0,sum=0,n[3];
cin>>x;

while (n>0){

	for(int s=0;s<3;s++){
	cin>>n[s];
	}
for(int s=0;s<3;s++){
	sum+n[s];
}
if(sum==2||sum==3)
	h++;
sum=0;

x--;
}
cout<<x<<endl;
return 0;}


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

int main(){
    int x,h=0,sum=0, n[3];
    cin>>x;
    while (x>0){
        for(int s=0 ; s<3 ; s++){
        cin>>n[s];
        }
        for( int s=0 ,s<3 ; s++){
            sum =sum+=n[s];
        }
            if(sum==2)||(sum==3)h++;
            sum==0;
            x--;
    }
            cout<<x<<end l;
            return 0;
    }
}


#include<iostream>
using namespace std;

int main(){

    int n,h=0,sum=0,a[3];
    cin>>n;
    while (n>0){
        for(int s=0;s<3;s++){
        cin>>a[s];
        }
        for(int s=0;s<3;s++){
            sum=sum+a[s];
            if(sum==2 || sum==3)
            h++;
            sum=0;
            n--;
        }
        cout<<h<<endl;
            return 0;
    }


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

int main() {

int n,h=0,sum=0,v[3];
cin>>n;

while (n>0){

	for(int s=0;s<3;s++){
	cin>>v[s];
	}
for(int s=0;s<3;s++){
	sum+v[s];
}
if(sum==2||sum==3)
	h++;
sum=0;

n--;
}
cout<<n<<endl;
return 0;}


#include<iostream>
using namespacw std;
int main(){
    int n,h=0,sum=0,a[3];
    cin>>n;
    while(n>0){
        for(int s=0 ; s<3 ; s++)
        {
        cin>>a[v];
        }
        for(int s=0 ; s<3 ; s++)
        {
        sum=sum+a[v];
        }
        if(sum==2 || sum==3)
        h++;
        sum=0;
        n--;
    }
        cout<<h<<endl;
    return 0
}


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

int main() {

int n,h=0,sum=0,v[3];
cin>>n;

while (n>0){

	for(int s=0;s<3;s++){
	cin>>v[s];
	}
for(int s=0;s<3;s++){
	sum+v[s];
}
if(sum==2||sum==3)
	h++;
sum=0;

n--;
}
cout<<h<<endl;
return 0;}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int z,h=0,sum=0, n[3];
    while x>3{
        for(int s=0 ; s<3 ; s++){
        cin>>n[v];}
        for( int s=0 ,s<3 ; s++){
            sum =sum+n[v];
            if(sum==2)||(sum==3)
            cout<<x;
            else
            cout<<sum;
            return 0;
    }
}


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

int main(){

    int x,h=0,sum=0, n[3];
cin>>x;
    while (x>0){
        for(int s=0 ; s<3 ; s++){
        cin>>n[s];
        }
        for( int s=0 ; s<3 ; s++){
            sum =sum+=n[s];
        }
            if((sum==2)||(sum==3))h++;
            sum==0;
            x--;
    }
            cout<<x<<end l;
            return 0;
    }
}


#include<iostream>
using namespace std;

int main(){

    int n,h=0,sum=0,a[3];
    cin>>n;
    while (n>0){
        for(int s=0;s<3;s++){
        cin>>a[s];
        }
        for(int s=0;s<3;s++){
            sum=sum+a[s];
        }
            if(sum==2 || sum==3)
            h++;
            sum=0;
            n--;
        }
        cout<<h<<endl;
            return 0;
    }


#include<iostream>
using namespace std;
int main(){
    int n,h=0,sum=0,a[3];
    cin>>n;
    while (n>0){
        for(int s=0 ; s<3 ; s++){
        cin>>a[s];
        }
        for(int s=0 ; s<3 ; s++){
            sum=sum+=a[s];
            if(sum==2 || sum==3)
            h++;
            sum=0;
            n--;
        }
            return 0;
    }


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

    int x,h=0,sum=0, n[3];

cin>>x;
    while (x>0){
        for(int s=0 ; s<3 ; s++){
        cin>>n[s];
        }
        for( int s=0 ; s<3 ; s++){
            sum =sum+n[s];
        }
            if(sum==2 || sum==3)h++;
            sum==0;
            x--;
    }
            cout<<x<<endl;
            return 0;
}


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

int main(){
    int x,h=0,sum=0, n[3];
    while (x>0){
        cin>>b;
        for(int s=0 ; s<3 ; s++){
        cin>>n[s];
        }
        for( int s=0 ,s<3 ; s++){
            sum =sum+=n[s];
        }
            if(sum==2)||(sum==3)h++;
            sum==0;
            x--;
    }
            cout<<x<<end l;
            return 0;
    }
}


#include<iostream>
using namespace std;
int main(){
    int x , l=0 , sum=0 , n[3];
    if(x>0)
    for(int s=0 ; s<3 ; s++){
    cin>>n[v]
    }
    for(int s=0 ; s<3 ; s++){
        sum=sum+n[v]
        if(sum==2)||(sum=3)
        cout<<x;
        else
        cout<<0;
    }
    return 0;
}


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

int main(){
    int z,h=0,sum=0, n[3];
    while (x>0){
        cin>>b;
        for(int s=0 ; s<3 ; s++){
        cin>>n[s];
        }
        for( int s=0 ,s<3 ; s++){
            sum =sum+=n[s];
        }
            if(sum==2)||(sum==3)h++;
            sum==0;
            x--;
    }
            cout<<x<<end l;
            return 0;
    }
}


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

int main(){
    int z,h=0,sum=0, n[3];
    while (x<3){
        cin>>b;
        for(int s=0 ; s<3 ; s++){
        cin>>n[v];
        }
        for( int s=0 ,s<3 ; s++){
            sum =sum+n[v];
            if(sum==2)||(sum==3)
            sum==0;
            x--;
            cout<<x<<end l;
            return 0;
    }
}


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

int main() {

    int x,h=0,sum=0, n[3];
cin>>x;
    while (x>0){
        for(int s=0 ; s<3 ; s++){
        cin>>n[s];
        }
        for( int s=0 ; s<3 ; s++){
            sum =sum+=n[s];
        }
            if(sum==2 || sum==3)h++;
            sum==0;
            x--;
    }
            cout<<x<<endl;
            return 0;
    }
}


#include<iostream>
using namespace std;
int main(){
    int x , l=0 , sum=0 , n[3];
    if(x>0)
    for(int s=0 ; s<3 ; s++){
    cin>>n[v]
    }
    for(int s=0 ; s<3 ; s++){
        sum=sum+n[v]
        if(sum==2)||(sum==3)
        cout<<x;
        else
        cout<<0;
    }
    return 0;
}


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

int main() {

    int x,h=0,sum=0, n[3];
cin>>x;
    while (x>0){
        for(int s=0 ; s<3 ; s++){
        cin>>n[s];
        }
        for( int s=0 ; s<3 ; s++){
            sum =sum+n[s];
        }
            if(sum==2 || sum==3)h++;
            sum==0;
            x--;
    }
            cout<<x<<endl;
            return 0;
}


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

int main(){

    int x,h=0,sum=0, n[3];
cin>>x;
    while (x>0){
        for(int s=0 ; s<3 ; s++){
        cin>>n[s];
        }
        for( int s=0 ; s<3 ; s++){
            sum =sum+=n[s];
        }
            if(sum==2)||(sum==3)h++;
            sum==0;
            x--;
    }
            cout<<x<<end l;
            return 0;
    }
}


#include<iostream>
using namespace std;
int main(){
    int n,h=0,sum=0,a[3];
    cin>>n;
    while (n>0){
        for(int s=0 ; s<3 ; s++){
        cin>>a[3];
        }
        for(int s=0 ; s<3 ; s++){
            sum=sum+=a[3];
            if(sum==2 || sum==3)
            h++;
            sum==0;
            n--;
        }
            return 0;
    }


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

int main() {

int n,h=0,sum=0,v[3];
cin>>n;

while (n>0){

	for(int s=0;s<3;s++){
	cin>>v[s];
	}
for(int s=0;s<3;s++){
	sum+v[s];
}
if(sum==2||sum==3)
	h++;
sum=0;

n--;
}
cout<<h<<endl;
return 0;
}


#include <iostream>

using namespace std;
int i,n,k,a
main(){
    for(i=1 ; i<=n ; i++){
        int x;
        for (j=0; j<3; j++){
            cin>>a;
            x+=a;
        }
        if (x!=1) k++;
    }
   cout<<k;
}


#include <iostream>

using namespace std;
int i,n,k,a,x,j;
main(){
    for(i=1 ; i<=n ; i++){

        for (j=0; j<3; j++){
            cin>>a;
            x+=a;
        }
        if (x!=1) k++;
    }
   cout<<k;
}


#include <iostream>
using namespace std;
int n,i,x,j,k,y;
main(){
   cin>>n;
   for(i=1 ; i<=n ; i++){
     for(j=1 ; j<=3 ; j++){
            cin>>k;

     }
     x=x+k;
            if(x>1) y++;
   }
    cout<<y;
}


#include <iostream>
using namespace std;
int n,i,x,j,k,y;
main(){
   cin>>n;
   for(i=1 ; i<=n ; i++){
     for(j=1 ; j<3 ; j++){
            cin>>k;

     }
     x=x+k;
            if(x>1) y++;
   }
    cout<<y;
}


#include <iostream>
using namespace std;
int n,i,x,j,k,y;
main(){
   cin>>n;
   for(i=1 ; i<=n ; i++){
     for(j=1 ; j<=3 ; j++){
            cin>>k;
             x=x+k;

     }

            if(x>1) y++;
            x=0;
   }
    cout<<y;
}


#include <iostream>
using namespace std;
int n,i,x,j,k,y;
main(){
   cin>>n;
   for(i=0 ; i<n ; i++){
     for(j=0 ; j<3 ; j++){
            cin>>k;
            x=x+k;
            if(x>1) y++;

     }
   }
    cout<<y;
}


#include <iostream>
using namespace std;
int n,i,x,j,k,y;
main(){
   cin>>n;
   for(i=0 ; i<n ; i++){
     for(j=1 ; j<3 ; j++){
            cin>>k;
            x=x+k;
            if(x>1) y++;

     }
   }
    cout<<y;
}


#include <iostream>

using namespace std;
int i,n,k,a;
main(){
    for(i=1 ; i<=n ; i++){
        int x;
        for (j=0; j<3; j++){
            cin>>a;
            x+=a;
        }
        if (x!=1) k++;
    }
   cout<<k;
}


#include <iostream>

using namespace std;
int i,n,k,a,x;
main(){
    for(i=1 ; i<=n ; i++){

        for (j=0; j<3; j++){
            cin>>a;
            x+=a;
        }
        if (x!=1) k++;
    }
   cout<<k;
}


#include <iostream>
using namespace std;
int n,i,x,j,k,y;
main(){
   cin>>n;
   for(i=1 ; i<=n ; i++){
     for(j=1 ; j<3 ; j++){
            cin>>k;
            x=x+k;
            if(x>1) y++;

     }
   }
    cout<<y;
}


#include <iostream>
using namespace std;
int main(){
int n,a,b,i,c,count=0;
cin >> n;
for (i=0;i<n;i++){
    cin >> a,b,c;
    if ( (a+b+c) >=2 ){
        count = count +1;
    }
    cout << count;
}


#include <iostream>

using namespace std;

int main()
{
 int n,i,j;
 int a=0;
 cin >> n;
 int arr[n][3];
 for (i=0;i<n;i++){
    for (j=0;j<3;j++){
            cin >> arr[i][j];
 }
}
   for (i=0;i<n;i++){
    if (( arr[i][0] + arr[i][1] + arr[i][2] ) >=2 ){
        a=a+1;
    }
    else
        a=a;
   }
   cout << a;
}


#include <iostream>
using namespace std;
int main(){
int n,a,b,i,c,count=0;
cin >> n;
for (i=0;i<n;i++){
    cin >> a>>b>>c;
    if ( (a+b+c) >=2 ){
        count = count +1;
    }
    }
    cout << count;
}


#include <iostream>

using namespace std;

int main()
{
 int n,i,j;
 int a=0;
 cin >> n;
 int arr[n][3];
 for (i=0;i<n;i++){
    for (j=0;j<3;j++){
            cin >> arr[i][j];
 }
}
   for (i=0;i<n;i++){
    if (( arr[i][0] + arr[i][1] + arr[i][2] + arr[i][3] ) >=2 ){
        a=a+1;
    }
   }
   cout << a;
}


#include <iostream>

using namespace std;

int main()
{
 int n,i,j;
 int a=0;
 cin >> n;
 int arr[n][3];
 for (i=0;i<n;i++){
    for (j=0;j<3;j++){
            cin >> arr[i}[j];
 }
}
   for (i=0;i<n;i++){
    if (( arr[i][0] + arr[i][1] + arr[i][2] + arr[i][3] ) >=2 ){
        a=a+1;
    }
   }
   cout << a;
}


#include <iostream>
using namespace std;
int main(){
int n,a,b,i,c,count=0;
cin >> n;
for (i=0;i<n;i++){
    cin >> a,b,c;
    if ( (a+b+c) >=2 ){
        count = count +1;
    }
    cout << count;
}
}


#include <iostream>
using namespace std;
int main(){
int n,a,b,c,count=0;
cin >> n;
for (i=0;i<n;i++){
    cin >> a,b,c;
    if ( (a+b+c) >=2 ){
        count = count +1;
    }
    cout << count;
}


#include <iostream>
using namespace std;
int main(){
int n,a,b,i,c,count=0;
cin >> n;
for (i=0;i<n;i++){
    cin >> a,b,c;
    if ( (a+b+c) >=2 ){
        count = count +1;
    }
    }
    cout << count;
}


#include <iostream>
#include <string>
#include <math.h>
using namespace std;
int main(){

    int a, count = 0, timer = 0, res = 0;
    int m[3][1000];
    cin >> a;

    for(int i = 0; i < 3; i++){

    for(int j = 0; j < a; j++){

        cin >> m[i][j];
        timer++;
        if(m[i][j])
        count++;
        }
        if(timer % 3 == 0){
            if(count > 1){
            res++;
            count=0;
            }
            }
    }

    cout << res;

return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main ()
{
int n,a[12345],b[12345],c[12345],ans=0;
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i]>>b[i]>>c[i];
if(a[i] + b[i] + c[i]>=2) {
ans++;
}
}
cout<<ans;
return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main ()
{
int n,a[3],b[3],c[3],ans=0;
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i]>>b[i]>>c[i];
if(a[i] + b[i] + c[i]>=2) {
ans++;
}
}
cout<<ans;
return 0;
}


#include <iostream>
#include <string>
#include <math.h>
using namespace std;
int main(){

    int a, m[3][1000], st = 0, nd = 0;

    cin >> a;

    for(int i = 0; i < 3; i++){

    for(int j = 0; j < a; j++){

        cin >> m[i][j];
        if(m[i][j])
        st++;
        else nd++;
        }
    }
cout << st/nd;

return 0;
}


#include <iostream>
#include <string>
#include <math.h>
using namespace std;
int main(){

    int a, count = 0, res = 0;
    int m[3][1000];
    cin >> a;

    for(int i = 0; i < 3; i++){

    for(int j = 0; j < a; j++){

        cin >> m[i][j];
        if(m[i][j])
        count++;
        }

            if(count > 1){
            res++;
            }
            count = 0;

    }

    cout << res;

return 0;
}


#include <iostream>
#include <string>
#include <math.h>
using namespace std;
int main(){

    int a, count = 0, timer = 0, res = 0;
    int m[3][1000];
    cin >> a;

    for(int i = 0; i < 3; i++){

    for(int j = 0; j < a; j++){

        cin >> m[i][j];
        timer++;
        if(m[i][j])
        count++;
        }
        if(timer % 3 == 0){
            if(count > 1){
            res++;
            }
            }
            count = 0;
    }

    cout << res;

return 0;
}


import math as ma
import sys
from sys import exit
from decimal import Decimal as dec
from itertools import permutations

def li():
	return list(map(int , input().split()))

def num():
	return map(int , input().split())

def nu():
	return int(input())

def find_gcd(x , y):
	while (y):
		x , y = y , x % y
	return x

n=nu()
a=li()
b=li()
z=[]
for i in range(n):
	z.append((a[i]+b[i],i))
z.sort()
fl=True
x=[]
cc=0
xp=0
mp={}
np=[]
for i in range(n):
	if(i==0):
		if(a[0]!=0 or b[0]>=n or (n-(a[0]+b[0])-1)<0):
			fl=False
	if(i==n-1):
		if(a[i]>=n or b[0]!=0 or (n-(a[0]+b[0])-1)<0):
			fl=False
	if((n-(a[0]+b[0])-1)<0):
		fl=False

for i in range(n):
	if(z[i][0]==cc):
		np.append(z[i][1])
		xp+=1
		continue
	if(z[i][0]==(cc+1)):
		x.append((cc,xp,np))
		cc+=1
		xp=1
		np=[]
		np.append(z[i][1])
		continue
	fl=False
	break
x.append((cc,xp,np))
if(fl==False):
	print("NO")
else:
	if(len(x)>n):
		print("NO")
	else:
		zz=[0]*n
		fo=len(x)
		for i in range(len(x)):
			nh=x[i][2]
			for j in range(len(nh)):
				zz[nh[j]]=fo
			fo-=1
		print("YES")
		print(*zz)


import math as ma
import sys
from sys import exit
from decimal import Decimal as dec
from itertools import permutations

def li():
	return list(map(int , input().split()))

def num():
	return map(int , input().split())

def nu():
	return int(input())

def find_gcd(x , y):
	while (y):
		x , y = y , x % y
	return x

n=nu()
a=li()
b=li()
z=[]
for i in range(n):
	z.append((a[i]+b[i],i))
z.sort()
fl=True
x=[]
cc=0
xp=0
mp={}
np=[]
for i in range(n):
	if(i==0):
		if(a[0]!=0 or b[0]>=n or (n-(a[0]+b[0])-1)<0):
			fl=False
	if(i==n-1):
		if(a[i]>=n or b[i]!=0 or (n-(a[i]+b[i])-1)<0):
			fl=False
	if((n-(a[i]+b[i])-1)<0):
		fl=False

for i in range(n):
	if(z[i][0]==cc):
		np.append(z[i][1])
		xp+=1
		continue
	if(z[i][0]==(cc+1)):
		x.append((cc,xp,np))
		cc+=1
		xp=1
		np=[]
		np.append(z[i][1])
		continue
	fl=False
	break
x.append((cc,xp,np))
if(fl==False):
	print("NO")
else:
	if(len(x)>n):
		print("NO")
	else:
		zz=[0]*n
		fo=len(x)
		for i in range(len(x)):
			nh=x[i][2]
			for j in range(len(nh)):
				zz[nh[j]]=fo
			fo-=1
		print("YES")
		print(*zz)


import math as ma
import sys
from sys import exit
from decimal import Decimal as dec
from itertools import permutations

def li():
	return list(map(int , input().split()))

def num():
	return map(int , input().split())

def nu():
	return int(input())

def find_gcd(x , y):
	while (y):
		x , y = y , x % y
	return x

n=nu()
a=li()
b=li()
z=[]
for i in range(n):
	z.append((a[i]+b[i],i))
z.sort()
fl=True
x=[]
cc=0
xp=0
mp={}
np=[]
for i in range(n):
	if(i==0):
		if(a[0]!=0 or b[0]>=n or (n-(a[0]+b[0])-1)<0):
			fl=False
	if(i==n-1):
		if(a[i]>=n or b[i]!=0 or (n-(a[i]+b[i])-1)<0):
			fl=False
	if((n-(a[i]+b[i])-1)<0):
		fl=False

for i in range(n):
	if(z[i][0]==cc):
		np.append(z[i][1])
		xp+=1
		continue
	if(z[i][0]==(cc+1)):
		x.append((cc,xp,np))
		cc+=1
		xp=1
		np=[]
		np.append(z[i][1])
		continue
	fl=False
	break
x.append((cc,xp,np))
if(fl==False):
	print("NO")
else:
	if(len(x)>n):
		print("NO")
	else:
		zz=[0]*n
		fo=len(x)
		for i in range(len(x)):
			nh=x[i][2]
			for j in range(len(nh)):
				zz[nh[j]]=fo
			fo-=1
		for i in range(n):
			xl=0
			xr=0
			for j in range(i+1,n):
				if(zz[j]>zz[i]):
					xr+=1
			for j in range(i-1,-1,-1):
				if (zz[j] > zz[i]):
					xl += 1
			if(xl!=a[i] and xr!=b[i]):
				fl=False
				break
		if(fl==True):
			print("YES")
			print(*zz)
		else:
			print("NO")


import math as ma
import sys
from sys import exit
from decimal import Decimal as dec
from itertools import permutations

def li():
	return list(map(int , input().split()))

def num():
	return map(int , input().split())

def nu():
	return int(input())

def find_gcd(x , y):
	while (y):
		x , y = y , x % y
	return x

n=nu()
a=li()
b=li()
z=[]
for i in range(n):
	z.append((a[i]+b[i],i))
z.sort()
fl=True
x=[]
cc=0
xp=0
mp={}
np=[]
for i in range(n):
	if(a[i]>i):
		fl=False
	if(b[i]>(n-i-1)):
		fl=False
	if((n-a[i]-b[i])<=0):
		fl=False

if(fl==False):
	print("NO")
else:
	zz=[0]*n
	for i in range(n):
		zz[i]=(n-a[i]-b[i])
	for i in range(n):
		xl = 0
		xr = 0
		for j in range(i + 1 , n):
			if (zz[j] > zz[i]):
				xr += 1
		for j in range(i - 1 , -1 , -1):
			if (zz[j] > zz[i]):
				xl += 1
		if (xl != a[i] or xr != b[i]):
			fl = False
			break
	if (fl == True):
		print("YES")
		print(*zz)
	else:
		print("NO")


n = int(input())
left = list(map(int,input().split()))
right = list(map(int,input().split()))

arr = [ n - left[i] - right[i] for i in range(n)]

def check(l, r, pos):
    if sum(elem > arr[pos] for elem in arr[pos+1:]) != r:
        return False
    if sum(elem > arr[pos] for elem in arr[:pos]) != l:
        return False

    return True

for i in range(n):
    if not check(left[i], right[i], i):
        print('NO')
        exit()

print('YES')
print(*arr)


n = int(input())
left = list(map(int,input().split()))
right = list(map(int,input().split()))

arr = [ n - left[i] - right[i] for i in range(n)]

def check(l, r, pos):
    if sum(elem > arr[pos] for elem in arr[pos+1:]) != r:
        return True
    if sum(elem > arr[pos] for elem in arr[:pos]) != l:
        return True

    return True

for i in range(n):
    if not check(left[i], right[i], i):
        print('NO')
        exit()

print('YES')
print(arr)


n = int(input())
left = list(map(int,input().split()))
right = list(map(int,input().split()))

arr = [ n - left[i] - right[i] for i in range(n)]

def check(l, r, pos):
    if sum(elem > arr[pos] for elem in arr[pos+1:]) != r:
        return True
    if sum(elem > arr[pos] for elem in arr[:pos]) != l:
        return True

    return True

for i in range(n):
    if not check(left[i], right[i], i):
        print('NO')
        exit()

print('YES')
print(*arr)


n=int(input()); c=[]; d=[]; check=1; dem=0
a=list(map(int, input().split()))
b=list(map(int, input().split()))
for i in range(n):
    c.append(a[i]+b[i])
for i in c:
    d.append(n-i)
    if(n-i<=0): check=2
    if i==0: dem+=1
if a[0]!=0 or b[n-1]!=0: print("NO")
elif dem>1 and dem != n: print("NO")
elif check==1:
    print("YES")
    for i in d: print(i, end=' ')
else: print("NO")


n=int(input()); c=[]; d=[]; check=1; dem=0
a=list(map(int, input().split()))
b=list(map(int, input().split()))
for i in range(n):
    c.append(a[i]+b[i])
for i in c:
    d.append(n-i)
    if(n-i<=0): check=2
    if i==0: dem+=1
if a[0]!=0 or b[n-1]!=0: print("NO")
elif dem>1: print("NO")
elif check==1:
    print("YES")
    for i in d: print(i, end=' ')
else: print("NO")


n=int(input()); c=[]; d=[]; check=1
a=list(map(int, input().split()))
b=list(map(int, input().split()))
for i in range(n):
    c.append(a[i]+b[i])
for i in c:
    d.append(n-i)
    if(n-i<=0): check=2
if check==1:
    print("YES")
    for i in d: print(i, end=' ')
else: print("NO")


n=int(input()); c=[]; d=[]; a1=[]; b1=[]; check=1
a=list(map(int, input().split()))
b=list(map(int, input().split()))
for i in range(n): c.append(a[i]+b[i])
for i in c: d.append(n-i)
for i in range(n):
    j=i; l=0; r=0
    for j in range(i,n):
    	if d[i]<d[j]: r+=1
    b1.append(r); j=0
    for j in range(i+1):
    	if d[i]<d[j]: l+=1
    a1.append(l)
for i in range(n):
    if(a[i]!=a1[i] or b[i]!=b1[i]): check+=1
if check==1:
    print("YES")
    for j in range(n): print(d[j], end=' ')
else: print("NO")


n=int(input()); c=[]; d=[]; check=1
a=list(map(int, input().split()))
b=list(map(int, input().split()))
for i in range(n):
    c.append(a[i]+b[i])
for i in c:
    d.append(n-i)
    if(n-i<=0): check=2
if a[0]!=0 or b[n-1]!=0: print("NO")
elif check==1:
    print("YES")
    for i in d: print(i, end=' ')
else: print("NO")


n=int(input()); c=[]; d=[]; check=1; dem=0
a=list(map(int, input().split()))
b=list(map(int, input().split()))
for i in range(n):
    c.append(a[i]+b[i])
for i in c:
    d.append(n-i)
    if(n-i<=0): check=2
    if i==n: dem+=1
if a[0]!=0 or b[n-1]!=0: print("NO")
elif dem>1: print("NO")
elif check==1:
    print("YES")
    for i in d: print(i, end=' ')
else: print("NO")


n=int(input()); c=[]
a=list(map(int, input().split()))
b=list(map(int, input().split()))
for i in range(n):
	c.append(a[i]+b[i])
for i in c:
	print(n-i, end=' ')


n=int(input()); c=[]; d=[]; check=1
a=list(map(int, input().split()))
b=list(map(int, input().split()))
for i in range(n):
    c.append(a[i]+b[i])
for i in c:
    d.append(n-i)
    if(n-i<=0): check=2
if a[0]!=0 or b[n-1]!=0: print("NO")
if check==1:
    print("YES")
    for i in d: print(i, end=' ')
else: print("NO")


n=int(input())
l=list(map(int, input().split()))
r=list(map(int, input().split()))
maxx=0
s=[]
it=0
for i in range(n):
    s.append(l[i]+r[i])
    if l[i]>i or r[i]>n-i-1:
        it=1
its=list(s)
while maxx<n:
    summ=0
    for i in range(n):
        if its[i]!=-1 and i<n-1 and r[i]<its[i+1:].count(-1):
            it=1
            break
        if its[i]!=-1 and i>0 and l[i]<its[:i].count(-1):
            it=1
            break
    if it==1:
        break
    for i in range(n):
        if s[i]==maxx:
            s[i]=-maxx
            its[i]=-1
            summ+=1

    if summ==0:
        it=1
        break
    maxx+=summ
if it==1:
    print('NO')
else:
    print('YES')
    for i in s:
        print(i-min(s)+1, end=' ')


n=int(input())
l=list(map(int, input().split()))
r=list(map(int, input().split()))
maxx=0
s=[]
it=0
for i in range(n):
    s.append(l[i]+r[i])
    if l[i]>i or r[i]>n-i-1:
        it=1
while maxx<n:
    summ=0
    for i in range(n):
        if s[i]==maxx:
            s[i]=-maxx
            summ+=1
    if summ==0:
        it=1
        break
    maxx+=summ
if it==1:
    print('NO')
else:
    print('YES')
    for i in s:
        print(i-min(s)+1, end=' ')


n=int(input())
l=list(map(int, input().split()))
r=list(map(int, input().split()))
maxx=0
s=[]
it=0
for i in range(n):
    s.append(l[i]+r[i])
    if l[i]>i or r[i]>n-i-1:
        it=1
its=list(s)
while maxx<n:
    summ=0
    ll=0
    rr=its.count(-1)
    for i in range(n):
        if its[i]==-1:
            ll+=1
            rr-=1
        if its[i]!=-1 and i<n-1 and r[i]<rr:
            it=1
            break
        if its[i]!=-1 and i>0 and l[i]<ll:
            it=1
            break
    if it==1:
        break
    for i in range(n):
        if s[i]==maxx:
            s[i]=-maxx
            its[i]=-1
            summ+=1

    if summ==0:
        it=1
        break
    maxx+=summ
if it==1:
    print('NO')
else:
    print('YES')
    for i in s:
        print(i-min(s)+1, end=' ')


n=int(input())
l=list(map(int, input().split()))
r=list(map(int, input().split()))
maxx=0
s=[]
it=0
for i in range(n):
    s.append(l[i]+r[i])
    if l[i]>i or r[i]>n-i-1:
        it=1
while maxx<n:
    summ=0
    for i in range(n):
        if s[i]==maxx:
            s[i]=-maxx
            summ+=1
    if summ==0:
        it=1
        break
    maxx+=summ
if it==1:
    print('NO')
else:
    for i in s:
        print(i-min(s)+1, end=' ')


n = int(input())
l = [int(x) for x in input().split()]
r = [int(x) for x in input().split()]
a = [0] * n
for i in range(n):
	a[i] = n - max(l[i], r[i])
	if a[i] < 0:
		print("NO")
		exit(0)
for i in range(n):
	max_l = 0
	max_r = 0
	for j in range(i):
		if a[j] > a[i]:
			max_l += 1
	for j in range(i + 1, n):
		if a[j] > a[i]:
			max_r += 1
	if max_l != l[i] or max_r != r[i]:
		print("NO")
		exit(0)
print("YES")
for x in a:
	print(x, end = ' ')


n = int(input())
l = [int(x) for x in input().split()]
r = [int(x) for x in input().split()]
a = [0] * n
for i in range(n):
	a[i] = n - (l[i] + r[i])
	if a[i] < 0:
		print("NO")
		exit(0)
for i in range(n):
	max_l = 0
	max_r = 0
	for j in range(i):
		if a[j] > a[i]:
			max_l += 1
	for j in range(i + 1, n):
		if a[j] > a[i]:
			max_r += 1
	if max_l != l[i] or max_r != r[i]:
		print("NO")
		exit(0)
print("YES")
for x in a:
	print(x, end = ' ')


n = int(input())
l = [int(x) for x in input().split()]
r = [int(x) for x in input().split()]
a = [0] * n
for i in range(n):
	a[i] = n - max(l[i] + r[i])
	if a[i] < 0:
		print("NO")
		exit(0)
for i in range(n):
	max_l = 0
	max_r = 0
	for j in range(i):
		if a[j] > a[i]:
			max_l += 1
	for j in range(i + 1, n):
		if a[j] > a[i]:
			max_r += 1
	if max_l != l[i] or max_r != r[i]:
		print("NO")
		exit(0)
print("YES")
for x in a:
	print(x, end = ' ')


n = int(input())
l = list(map(int, input().split()))
r = list(map(int, input().split()))
a = [0] * n
for i in range(n):
    a[i] = n - (l[i] + r[i])

flag = True
for i in range(n):
    tmp = 0
    for j in range(i + 1, n):
        if a[i] < a[j]:
            tmp += 1

    if tmp != r[i]:
        flag = False
        break

    tmp = 0
    for j in range(i):
        if a[i] < a[j]:
            tmp += 1

    if tmp != l[i]:
        flag = False
        break

if flag:
    print("YES")
    print(" ".join(map(str, a)))
else:
    print("NO")


n = int(input())
l = list(eval(input().replace(' ',',')))
r = list(eval(input().replace(' ',',')))
s = [ (i,sum(v)) for i,(v) in enumerate(zip(l,r)) ]
ss = sorted(s, key= lambda a:a[1] )

candies = [0]*n
for p in ss:
    candies[p[0]] = n-p[1]

ll = [0]*n
for i in range(1,n):
    ll[i] = sum([1 for c in candies[:i] if c > candies[i]])

rr = [0]*n
for i in range(n-1)[::-1]:
    rr[i] = sum([1 for c in candies[i:] if c > candies[i]])

if min(candies) <= 1 or max(candies) > n or max(l) > n or max(r) > n:
    print("NO")
else:
    for i in range(n):
        if ll[i] != l[i]:
            print("NO")
            break
        if rr[i] != r[i]:
            print("NO")
            break
        if i == n-1:
            print("YES")
            print(' '.join(map(str,candies)))


n = int(input())
l = tuple(map(int,input().split()))
r = tuple(map(int,input().split()))
s = [ (i,sum(v)) for i,(v) in enumerate(zip(l,r)) ]
ss = sorted(s, key= lambda a:a[1] )

candies = [0]*n
for p in ss:
    candies[p[0]] = n-p[1]

ll = [0]
for i in range(1,n):
    ll.append(sum([1 for c in candies[:i] if c > candies[i]]))

rr = [0]
for i in range(n-2,-1,-1):
    rr.append(sum([1 for c in candies[i:] if c > candies[i]]))

for i in range(n):
    if ll[i] != l[i]:
        print("NO")
        break
    if rr[n-1-i] != r[i]:
        print("NO")
        break
    if i == n-1:
        print("YES")
        print(' '.join(map(str,candies)))


n=int(input())
le=[int(i) for i in input().split()]
ri=[int(i) for i in input().split()]
notp = False
check=[]
for i in range(n):
    check.append(n-le[i]-ri[i])
for i in range(n):
    tot=0
    for j in range(i-1,-1,-1):
        if(check[j]>check[i]):
            tot+=1
    if(tot!=le[i]):
        notp=True
        break
if(notp==False):
    for i in range(n):
        tot=0
        for j in range(i+1,n):
            if(check[j]>check[i]):
                tot+=1
        if(tot!=ri[i]):
            notp=True
            break
if(notp):
    print('NO')
else:
    print('YES')
    print(*check)


n=int(input())
l=[int(x) for x in input().split()]
r =[int(x) for x in input().split()]
flag=1
a=[n-l[i]-r[i] for i in range(n)]
for i in range(n):
    cl=0
    cr=0
    for j in range(i):
        if a[j]>a[i]:
            cl+=1
    for k in range(i+1,n):
        if a[k]>a[i]:
            cr+=1

    if cl!=l[i] or cr!=r[i]:
        print('NO')
        flag=0
        break

if flag:
    print('YES')
    print(*a)