QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#463489#3560. Stray CatRafi22#100 ✓36ms13256kbC++202.9kb2024-07-04 21:47:442024-07-04 21:47:45

Judging History

你现在查看的是最新测评结果

  • [2024-07-04 21:47:45]
  • 评测
  • 测评结果:100
  • 用时:36ms
  • 内存:13256kb
  • [2024-07-04 21:47:44]
  • 提交

Anthony

#include "Anthony.h"
#include<bits/stdc++.h>

using namespace std;

#ifdef DEBUG
auto&operator<<(auto&o,pair<auto,auto>p){return o<<"("<<p.first<<", "<<p.second<<")";}
auto operator<<(auto&o,auto x)->decltype(x.end(),o){o<<"{";int i=0;for(auto e:x)o<<","+!i++<<e;return o<<"}";}
#define debug(X...)cerr<<"["#X"]: ",[](auto...$){((cerr<<$<<"; "),...)<<endl;}(X)
#else
#define debug(...){}
#endif

#define ll long long
#define pb push_back
#define st first
#define nd second
#define sz(x) (int)(x).size()
#define all(x) (x).begin(),(x).end()
#define FOR(i,l,r) for(int i=(l);i<=(r);i++)
#define ROF(i,r,l) for(int i=(r);i>=(l);i--)

namespace {

const int N=20007;

vector<pair<int,int>>G[N];
vector<int>col;
bool odw[N];

vector<int>P={1,1,0,1,0,0};

void dfs(int v,int o,int d,int k)
{
	odw[v]=1;
	int C=0;
	if(k!=-1) 
	{
		col[k]=P[d];
		C=col[k];
	}
	debug(C,v);
	for(auto [u,c]:G[v]) 
	{
		if(u==o||odw[u]) continue;
		if(sz(G[v])==2) dfs(u,v,(d+1)%6,c);
		else
		{
			if(C) dfs(u,v,2,c);
			else dfs(u,v,0,c);
		} 
	}
}

}

vector<int> Mark(int n,int m,int A,int B,vector<int>U,vector<int>V) 
{
	col.resize(m);
	FOR(i,0,m-1)
	{
		G[U[i]].pb({V[i],i});
		G[V[i]].pb({U[i],i});
		col[i]=2;
	}
	dfs(0,0,0,-1);
	debug(col);
	return col;
}

Catherine

#include "Catherine.h"
#include<bits/stdc++.h>

using namespace std;

#ifdef DEBUG
auto&operator<<(auto&o,pair<auto,auto>p){return o<<"("<<p.first<<", "<<p.second<<")";}
auto operator<<(auto&o,auto x)->decltype(x.end(),o){o<<"{";int i=0;for(auto e:x)o<<","+!i++<<e;return o<<"}";}
#define debug(X...)cerr<<"["#X"]: ",[](auto...$){((cerr<<$<<"; "),...)<<endl;}(X)
#else
#define debug(...){}
#endif

#define ll long long
#define pb push_back
#define st first
#define nd second
#define sz(x) (int)(x).size()
#define all(x) (x).begin(),(x).end()
#define FOR(i,l,r) for(int i=(l);i<=(r);i++)
#define ROF(i,r,l) for(int i=(r);i>=(l);i--)

namespace {
	int last=-1;
	bool ok=0;
	vector<int>V;
	set<vector<int>>X;
	vector<int>P={1,1,0,1,0,0};
}


void Init(int A, int B) {
	FOR(i,0,5) 
	{
		vector<int>VV;
		ROF(j,i,i-10)
		{
			VV.pb(P[(j%6+6)%6]);
			debug(VV);
			X.insert(VV);
		}
	}
}

int Move(vector<int>y)
{
	debug(last,y[0],y[1]);
	int S=y[0]+y[1];
	if(ok)
	{
		if(S>1) y[last]++;
		if(y[0]==1) return last=0;
		else return last=1;
	}
	else if(last==-1)
	{
		if(S!=2)
		{
			ok=1;
			if(y[0]==1) return last=0;
			else return last=1;
		}
		else
		{
			if(y[0]==2) V={0,0};
			else if(y[0]==1) V={0,1};
			else V={1,1};
			return last=V.back();
		}
	}
	else
	{
		if(S==0)
		{
			ok=1;
			return -1;
		}
		else if(S==1)
		{
			int t;
			if(y[0]==1) t=0;
			else t=1;
			V.pb(t);
			debug(V);
			if(sz(V)<10&&!X.count(V))
			{
				ok=1;
				return -1;
			}
			else return last=t;
		}
		else
		{
			ok=1;
			y[last]++;
			if(y[last]==1) return -1;
			if(y[0]==1) return last=0;
			else return last=1;
		}
	}
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 2
Accepted

Test #1:

score: 2
Accepted
time: 28ms
memory: 12480kb

input:

20000 19999 4 0 4854
4424 11648
889 16115
4439 10593
3858 14508
8499 19385
9478 12396
1012 13407
6863 11342
1896 15127
5622 9551
16073 18930
13539 17244
13057 19981
536 7153
15447 15948
11950 19557
1121 17461
10380 15722
16143 19800
10630 11823
3669 16972
3915 18147
3313 4569
2908 3474
4490 18883
54...

output:

0 0 0 1 1 1 0 1 1 1 1 1 1 0 1 0 0 1 1 0 0 1 0 0 0 0 0 1 1 0 0 0 1 1 1 1 1 0 1 1 0 1 1 1 0 0 0 1 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 0 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 1 0 0 1 1 0 0 1 0 1 1 1 1 0 1 0 1 1 1 1 1 1 0 0 0 1 1 0 1 1 0 1 0 0 1 1 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 1 1 1 1 1 0 1 1 1 0 1 1 1 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 5104

result:

ok Number of moves = 5104

Test #2:

score: 2
Accepted
time: 2ms
memory: 4224kb

input:

2 1 4 0 1
0 1

output:

1 

input:

Interaction has been finished!

output:

Number of moves = 1

result:

ok Number of moves = 1

Test #3:

score: 2
Accepted
time: 14ms
memory: 12160kb

input:

20000 19999 4 0 12741
0 8045
10830 12741
11047 12741
7734 12741
10496 12741
0 19310
12741 15324
12741 15111
0 16665
12741 19940
0 7345
0 8973
0 12965
1856 12741
0 9366
0 16761
3689 12741
3262 12741
0 14953
10685 12741
0 8939
7504 12741
8497 12741
0 7105
6021 12741
0 10213
12741 17648
11043 12741
127...

output:

1 0 0 0 0 1 0 0 1 0 1 1 1 0 1 1 0 0 1 0 1 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 1 1 1 0 0 0 0 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 0 1 1 0 0 1 1 1 0 0 1 1 1 1 1 0 1 1 0 0 0 0 1 1 0 1 0 1 1 0 0 0 1 1 1 1 1 0 1 1 1 0 1 1 1 0 1 0 0 1 1 1 0 1 0 1 0 1 0 0 1 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 0 0 0 1 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 1

result:

ok Number of moves = 1

Test #4:

score: 2
Accepted
time: 32ms
memory: 13256kb

input:

20000 19999 4 0 13682
14008 14375
12989 15355
11902 12963
11478 15501
1504 2026
9127 18518
1497 7374
10678 12718
8520 12575
6716 13047
5388 14856
13722 18494
1950 13535
5607 12005
14758 18493
1227 19659
7519 15113
795 10727
10032 11445
1219 2439
3316 15163
13150 14939
7328 11534
17496 19036
7970 115...

output:

0 0 0 1 1 0 0 0 1 1 1 0 1 1 0 0 1 0 0 0 0 1 0 1 1 0 0 0 1 1 0 1 0 0 1 0 1 0 1 1 1 1 1 1 1 0 1 0 1 0 0 0 0 1 1 0 1 1 1 0 0 0 1 0 1 1 1 1 0 1 0 1 0 1 1 1 0 1 0 0 0 0 1 1 0 0 0 1 0 0 1 1 0 0 1 0 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 1 0 0 1 0 0 1 0 1 0 0 0 1 0 0 1 1 1 1 0 1 1 1 1 1 0 1 1 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 19999

result:

ok Number of moves = 19999

Test #5:

score: 2
Accepted
time: 30ms
memory: 13180kb

input:

20000 19999 4 0 3481
5711 8937
3753 19017
5157 14683
3445 12544
15536 17773
12298 16110
3658 10260
3390 19125
8235 19809
3181 3860
6693 11189
14139 15899
17033 17584
1760 5212
4173 11952
16252 18681
11928 19038
6295 9977
7235 13107
1305 18192
15834 16164
13263 19938
7378 10689
7424 13794
7385 10183
...

output:

1 1 0 0 0 0 1 1 1 0 1 0 1 1 1 1 1 0 0 1 1 0 1 1 0 1 0 0 1 1 0 0 1 1 1 0 0 1 0 1 1 0 0 1 1 1 1 0 0 1 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 0 0 1 0 1 1 0 0 1 0 0 0 1 1 1 0 0 0 0 0 1 0 1 0 1 1 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 1 1 1 1 0 1 1 1 0 0 0 0 0 0 1 1 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 20000

result:

ok Number of moves = 20000

Test #6:

score: 2
Accepted
time: 16ms
memory: 12192kb

input:

20000 19999 4 0 17749
4560 5540
6063 14791
9782 15051
3499 16344
5069 12857
15481 18881
2769 10534
4926 15405
3205 5009
2726 6821
5023 14366
5231 7318
9839 14776
1161 8871
12125 12912
6416 7685
11665 17025
10516 17085
1083 11585
1769 18004
915 6569
7199 11381
11017 17458
7260 12345
11635 17303
3903 ...

output:

1 0 0 1 0 0 1 1 0 1 0 1 1 1 0 1 0 1 1 0 1 1 1 1 1 0 0 0 0 0 1 0 0 0 1 1 1 0 1 1 0 1 1 0 0 1 1 1 1 0 1 0 0 1 1 1 0 1 1 0 1 1 1 0 0 1 0 0 1 0 0 0 1 0 0 1 1 0 0 1 0 0 1 1 1 1 1 0 1 1 1 1 0 1 0 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 0 1 0 1 1 1 1 1 0 0 1 1 0 1 0 1 1 1 1 0 1 0 1 1 1 0 0 1 1 1 0 0 1 1 1 1 0 1 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 2155

result:

ok Number of moves = 2155

Test #7:

score: 2
Accepted
time: 24ms
memory: 12104kb

input:

20000 19999 4 0 5815
4560 5540
6063 14791
9782 15051
3499 16344
5069 12857
15481 18881
2769 10534
4926 15405
3205 5009
2726 6821
5023 14366
5231 7318
9839 14776
1161 8871
12125 12912
6416 7685
11665 17025
10516 17085
1083 11585
1769 18004
915 6569
7199 11381
11017 17458
7260 12345
11635 17303
3903 1...

output:

1 0 0 1 0 0 1 1 0 1 0 1 1 1 0 1 0 1 1 0 1 1 1 1 1 0 0 0 0 0 1 0 0 0 1 1 1 0 1 1 0 1 1 0 0 1 1 1 1 0 1 0 0 1 1 1 0 1 1 0 1 1 1 0 0 1 0 0 1 0 0 0 1 0 0 1 1 0 0 1 0 0 1 1 1 1 1 0 1 1 1 1 0 1 0 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 0 1 0 1 1 1 1 1 0 0 1 1 0 1 0 1 1 1 1 0 1 0 1 1 1 0 0 1 1 1 0 0 1 1 1 1 0 1 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 2258

result:

ok Number of moves = 2258

Test #8:

score: 2
Accepted
time: 16ms
memory: 13196kb

input:

20000 19999 4 0 18199
1930 17301
9815 11509
5680 12498
5444 15877
12174 12697
11440 12005
10202 15023
4522 5384
8383 8752
5355 10816
3061 8434
6803 16128
2793 4232
15277 15360
9821 12463
5108 7146
4844 17890
16318 17908
6280 6331
6632 14259
3109 8883
5307 19423
7242 16555
12206 19332
7198 19076
6534...

output:

0 0 0 0 1 0 0 1 1 0 1 0 1 1 1 0 0 0 1 1 1 1 1 0 1 0 1 0 0 0 0 0 1 1 0 1 1 0 1 0 0 0 0 1 0 0 0 1 1 0 1 1 1 0 1 1 1 0 0 0 1 1 0 0 0 1 1 0 0 0 0 1 0 0 1 1 1 0 1 0 1 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 0 1 0 0 0 0 1 1 1 0 1 1 0 1 0 0 0 1 0 0 1 0 1 0 1 1 1 0 1 1 0 0 1 0 1 1 1 1 0 0 1 1 0 0 0 1 0 1 1 0 0 1 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 13246

result:

ok Number of moves = 13246

Test #9:

score: 2
Accepted
time: 20ms
memory: 12636kb

input:

20000 19999 4 0 717
1930 17301
9815 11509
5680 12498
5444 15877
12174 12697
11440 12005
10202 15023
4522 5384
8383 8752
5355 10816
3061 8434
6803 16128
2793 4232
15277 15360
9821 12463
5108 7146
4844 17890
16318 17908
6280 6331
6632 14259
3109 8883
5307 19423
7242 16555
12206 19332
7198 19076
6534 1...

output:

0 0 0 0 1 0 0 1 1 0 1 0 1 1 1 0 0 0 1 1 1 1 1 0 1 0 1 0 0 0 0 0 1 1 0 1 1 0 1 0 0 0 0 1 0 0 0 1 1 0 1 1 1 0 1 1 1 0 0 0 1 1 0 0 0 1 1 0 0 0 0 1 0 0 1 1 1 0 1 0 1 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 0 1 0 0 0 0 1 1 1 0 1 1 0 1 0 0 0 1 0 0 1 0 1 0 1 1 1 0 1 1 0 0 1 0 1 1 1 1 0 0 1 1 0 0 0 1 0 1 1 0 0 1 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 13249

result:

ok Number of moves = 13249

Subtask #2:

score: 2
Accepted

Test #10:

score: 2
Accepted
time: 18ms
memory: 11532kb

input:

17000 20000 4 0 12619
13144 15055
4989 15711
2356 5009
1727 16587
9362 10329
7811 10259
10193 11416
6111 15167
280 1169
7504 13721
5629 6802
2309 16712
1416 10913
2896 8725
6181 16997
648 7448
6744 12886
7179 13832
14616 15715
5540 15126
4268 8744
9841 13672
5292 5475
12312 14802
8118 8670
2290 1444...

output:

0 1 1 0 0 1 1 0 1 0 0 0 1 1 0 0 1 1 0 1 1 0 1 1 0 0 0 0 0 1 1 0 1 1 1 0 1 1 0 1 0 0 0 1 1 1 1 0 1 0 0 1 1 1 1 0 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 1 0 0 0 1 1 1 1 0 0 0 1 0 1 2 2 0 1 1 1 1 0 0 0 1 0 0 1 1 1 1 0 1 0 0 1 0 0 0 0 0 1 1 1 1 0 1 0 1 1 2 0 0 1 1 0 0 1 1 1 0 1 2 0 0 0 1 1 0 0 0 0 0 1 1 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 3833

result:

ok Number of moves = 3833

Test #11:

score: 2
Accepted
time: 16ms
memory: 11108kb

input:

17000 20000 4 0 9756
13144 15055
4989 15711
2356 5009
1727 16587
9362 10329
7811 10259
10193 11416
6111 15167
280 1169
7504 13721
5629 6802
2309 16712
1416 10913
2896 8725
6181 16997
648 7448
6744 12886
7179 13832
14616 15715
5540 15126
4268 8744
9841 13672
5292 5475
12312 14802
8118 8670
2290 14446...

output:

0 1 1 0 0 1 1 0 1 0 0 0 1 1 0 0 1 1 0 1 1 0 1 1 0 0 0 0 0 1 1 0 1 1 1 0 1 1 0 1 0 0 0 1 1 1 1 0 1 0 0 1 1 1 1 0 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 1 0 0 0 1 1 1 1 0 0 0 1 0 1 2 2 0 1 1 1 1 0 0 0 1 0 0 1 1 1 1 0 1 0 0 1 0 0 0 0 0 1 1 1 1 0 1 0 1 1 2 0 0 1 1 0 0 1 1 1 0 1 2 0 0 0 1 1 0 0 0 0 0 1 1 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 2829

result:

ok Number of moves = 2829

Test #12:

score: 2
Accepted
time: 24ms
memory: 11052kb

input:

17000 20000 4 0 3817
6191 14877
3081 9583
469 1711
4511 4566
9403 16559
1567 15933
8984 14488
13492 14188
3350 16312
1759 6316
1338 3324
215 6388
12145 14280
2180 16892
1673 13474
2562 11409
1338 15210
2319 8986
3448 11485
5052 7284
7014 14599
3388 7521
6165 15484
7036 8495
3251 8318
13782 15941
147...

output:

0 0 0 0 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 0 1 1 1 0 1 1 1 0 0 1 1 1 1 1 1 1 0 1 1 0 1 0 1 0 0 0 0 1 1 1 1 0 0 1 0 1 1 0 0 0 1 1 1 0 0 0 0 0 1 0 0 0 0 0 1 1 1 1 0 1 1 0 1 0 0 1 0 0 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 0 1 0 1 1 1 0 1 0 0 0 1 1 1 0 0 1 0 0 0 1 0 1 0 0 0 1 1 1 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 1214

result:

ok Number of moves = 1214

Test #13:

score: 2
Accepted
time: 14ms
memory: 11064kb

input:

17000 20000 4 0 5094
6191 14877
3081 9583
469 1711
4511 4566
9403 16559
1567 15933
8984 14488
13492 14188
3350 16312
1759 6316
1338 3324
215 6388
12145 14280
2180 16892
1673 13474
2562 11409
1338 15210
2319 8986
3448 11485
5052 7284
7014 14599
3388 7521
6165 15484
7036 8495
3251 8318
13782 15941
147...

output:

0 0 0 0 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 0 1 1 1 0 1 1 1 0 0 1 1 1 1 1 1 1 0 1 1 0 1 0 1 0 0 0 0 1 1 1 1 0 0 1 0 1 1 0 0 0 1 1 1 0 0 0 0 0 1 0 0 0 0 0 1 1 1 1 0 1 1 0 1 0 0 1 0 0 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 0 1 0 1 1 1 0 1 0 0 0 1 1 1 0 0 1 0 0 0 1 0 1 0 0 0 1 1 1 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 289

result:

ok Number of moves = 289

Test #14:

score: 2
Accepted
time: 8ms
memory: 11268kb

input:

17000 20000 4 0 13690
6406 9288
674 6677
3849 15396
1393 4328
11255 13874
7711 8113
591 9808
2110 16064
2655 10126
1472 4885
963 11977
236 13029
7018 8371
1592 5731
7151 10026
7647 9198
6663 11715
11808 14386
4184 9119
5978 14904
23 9649
7533 9524
2128 5456
6622 11701
36 9542
5949 11432
6226 6632
56...

output:

1 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 0 1 0 1 1 1 0 1 1 0 0 0 1 0 1 1 1 0 1 0 0 1 0 1 1 0 0 1 0 1 0 0 0 1 0 1 1 1 0 1 1 0 0 0 1 0 0 0 1 0 1 1 0 1 0 0 0 1 0 1 0 0 1 1 0 0 0 1 0 0 1 1 1 1 0 0 0 1 1 0 1 1 0 1 0 1 1 0 1 1 1 1 1 0 1 1 0 0 1 0 1 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 1 1 0 1 1 1 1 1 1 0 1 0 0 1 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 1188

result:

ok Number of moves = 1188

Test #15:

score: 2
Accepted
time: 14ms
memory: 11588kb

input:

17000 20000 4 0 11069
6406 9288
674 6677
3849 15396
1393 4328
11255 13874
7711 8113
591 9808
2110 16064
2655 10126
1472 4885
963 11977
236 13029
7018 8371
1592 5731
7151 10026
7647 9198
6663 11715
11808 14386
4184 9119
5978 14904
23 9649
7533 9524
2128 5456
6622 11701
36 9542
5949 11432
6226 6632
56...

output:

1 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 0 1 0 1 1 1 0 1 1 0 0 0 1 0 1 1 1 0 1 0 0 1 0 1 1 0 0 1 0 1 0 0 0 1 0 1 1 1 0 1 1 0 0 0 1 0 0 0 1 0 1 1 0 1 0 0 0 1 0 1 0 0 1 1 0 0 0 1 0 0 1 1 1 1 0 0 0 1 1 0 1 1 0 1 0 1 1 0 1 1 1 1 1 0 1 1 0 0 1 0 1 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 1 1 0 1 1 1 1 1 1 0 1 0 0 1 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 10330

result:

ok Number of moves = 10330

Test #16:

score: 2
Accepted
time: 24ms
memory: 12644kb

input:

20000 20000 4 0 8845
11288 16801
2126 4371
4720 14471
413 2714
186 4604
2352 4201
6986 12866
10872 19331
957 19085
5687 7193
12499 15595
12301 18292
2928 16938
6990 16439
5354 6261
4542 4655
1630 11240
2355 15603
7413 11528
2138 19136
6912 10696
3989 11484
2542 11318
16351 19754
3757 5878
7581 8369
...

output:

0 1 0 0 0 0 1 0 0 1 0 1 1 0 0 0 0 0 1 1 1 1 0 1 1 0 0 1 1 0 1 0 1 1 0 0 0 1 0 0 0 0 1 1 0 0 1 1 0 0 1 0 1 0 0 1 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 0 0 1 1 1 1 0 1 1 0 0 0 1 1 0 0 0 0 0 1 0 1 0 1 0 0 0 1 1 1 0 1 1 0 0 0 0 0 1 1 0 1 1 1 1 1 1 0 1 0 0 1 0 0 0 0 1 1 1 1 0 0 1 0 1 1 1 1 1 1 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 10004

result:

ok Number of moves = 10004

Subtask #3:

score: 2
Accepted

Test #17:

score: 2
Accepted
time: 6ms
memory: 10528kb

input:

20000 19999 3 0 19600
5632 15031
10854 19321
3093 5123
12611 17519
1474 14772
5370 18174
5202 17042
1990 5303
10137 14721
7120 16544
1810 12366
6907 16881
14575 18737
17365 17602
5780 8876
1518 8310
2276 19515
2269 9645
16762 18567
10684 17675
4576 6105
13666 18356
5635 15131
5436 7751
14955 19728
9...

output:

1 1 0 0 1 1 1 1 1 0 1 0 0 1 0 1 0 1 0 1 1 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 1 0 1 0 0 0 0 0 0 1 1 0 0 1 1 0 1 0 1 0 0 1 1 1 1 0 1 1 0 0 1 0 0 0 0 1 0 0 1 0 0 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 1 1 1 1 0 0 0 0 1 1 1 0 1 1 0 0 1 1 1 0 0 1 1 0 0 1 1 0 0 1 0 1 1 0 1 0 0 0 0 0 0 1 1 0 1 1 1 1 1 0 0 1 1 1 1 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 930

result:

ok Number of moves = 930

Test #18:

score: 2
Accepted
time: 2ms
memory: 4628kb

input:

2 1 3 0 1
0 1

output:

1 

input:

Interaction has been finished!

output:

Number of moves = 1

result:

ok Number of moves = 1

Test #19:

score: 2
Accepted
time: 8ms
memory: 10672kb

input:

20000 19999 3 0 18532
9747 18532
17161 18532
0 8031
13170 18532
14624 18532
0 12186
0 10140
0 3667
15000 18532
0 15557
17764 18532
0 8725
0 18259
0 8060
3323 18532
0 14397
0 7077
18532 19240
0 1786
0 12769
0 4712
18532 18536
0 3389
6985 18532
0 11416
16455 18532
0 17241
8986 18532
11751 18532
0 5988...

output:

0 0 1 0 0 1 1 1 0 1 0 1 1 1 0 1 1 0 1 1 1 0 1 0 1 0 1 0 0 1 1 1 1 1 0 0 0 1 1 0 1 1 0 1 1 0 1 1 1 1 1 1 1 0 1 1 1 0 0 1 1 1 1 1 1 0 1 0 1 1 0 0 0 1 0 0 0 1 0 1 1 0 0 1 0 0 1 1 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 0 0 1 0 1 1 0 0 1 0 0 1 1 0 1 1 1 0 1 1 1 0 1 0 1 0 1 0 0 0 0 0 0 1 0 1 0 1 1 0 0 1 1 0 0 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 1

result:

ok Number of moves = 1

Test #20:

score: 2
Accepted
time: 36ms
memory: 11576kb

input:

20000 19999 3 0 16798
7619 15574
8829 8833
13409 17464
6006 12194
5226 13736
11194 15579
5619 12450
39 7952
12975 15049
3564 14630
10790 16349
1054 14859
767 19472
1852 14305
511 19568
2904 11870
5955 8819
6703 8239
2793 4371
1939 13908
7112 18636
14924 19936
3825 16450
15846 17040
5788 14104
13775 ...

output:

1 0 1 0 1 1 0 0 0 0 1 0 0 1 1 1 1 1 1 0 0 1 0 0 0 0 1 0 0 1 0 0 1 0 1 1 0 0 0 1 1 0 1 0 0 1 0 0 0 1 1 0 0 0 1 0 1 0 1 1 0 1 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 0 1 0 1 1 1 0 0 0 0 1 1 1 1 0 1 0 1 0 1 1 0 1 1 1 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 19999

result:

ok Number of moves = 19999

Test #21:

score: 2
Accepted
time: 30ms
memory: 11660kb

input:

20000 19999 3 0 9522
822 9054
19145 19570
2259 5823
12892 19821
323 5977
7690 12849
10820 16683
8415 10732
13388 17773
5953 14245
7161 17152
13385 14411
7081 18663
2689 7736
3599 3953
8421 8710
1027 4408
1123 10996
1353 14489
11474 19177
12524 18725
1766 19281
4858 15539
9154 15643
1719 4929
10406 1...

output:

1 1 0 1 0 0 1 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 0 0 1 0 1 1 1 1 0 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 1 0 0 1 0 1 1 1 0 0 1 1 0 0 1 1 1 0 1 0 1 0 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1 0 0 0 1 1 0 1 0 0 0 0 0 0 1 0 0 0 1 1 0 1 0 0 1 1 0 0 1 1 0 0 0 1 1 1 1 1 0 1 1 0 1 1 1 1 0 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 20000

result:

ok Number of moves = 20000

Test #22:

score: 2
Accepted
time: 14ms
memory: 10532kb

input:

20000 19999 3 0 13747
15598 18876
14575 15888
451 2762
1040 6216
4777 16339
9993 14616
6203 8329
3051 6645
10154 19561
5134 13052
1400 13532
4449 5373
918 1831
13032 14433
9532 13911
15151 18654
2877 5186
1104 8322
2847 18011
9505 14382
5758 14013
6826 8971
6779 13456
8748 12121
6895 12878
9621 1787...

output:

0 1 1 0 0 0 1 1 0 0 1 0 0 1 1 1 0 1 1 1 0 1 1 0 1 1 0 0 0 1 1 0 0 0 1 1 0 1 1 1 0 1 0 0 1 0 1 1 1 1 1 1 0 1 0 0 0 1 1 0 1 1 0 0 0 1 0 0 0 1 0 0 1 0 1 1 1 1 0 0 1 1 0 1 0 0 1 1 1 0 1 1 0 1 1 0 1 1 1 1 0 0 1 0 0 0 0 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 0 1 1 0 0 0 0 1 0 1 1 0 0 1 0 0 1 1 0 0 1 1 0 1 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 2124

result:

ok Number of moves = 2124

Test #23:

score: 2
Accepted
time: 24ms
memory: 10684kb

input:

20000 19999 3 0 2694
15598 18876
14575 15888
451 2762
1040 6216
4777 16339
9993 14616
6203 8329
3051 6645
10154 19561
5134 13052
1400 13532
4449 5373
918 1831
13032 14433
9532 13911
15151 18654
2877 5186
1104 8322
2847 18011
9505 14382
5758 14013
6826 8971
6779 13456
8748 12121
6895 12878
9621 17876...

output:

0 1 1 0 0 0 1 1 0 0 1 0 0 1 1 1 0 1 1 1 0 1 1 0 1 1 0 0 0 1 1 0 0 0 1 1 0 1 1 1 0 1 0 0 1 0 1 1 1 1 1 1 0 1 0 0 0 1 1 0 1 1 0 0 0 1 0 0 0 1 0 0 1 0 1 1 1 1 0 0 1 1 0 1 0 0 1 1 1 0 1 1 0 1 1 0 1 1 1 1 0 0 1 0 0 0 0 0 1 1 1 1 0 1 1 0 1 1 0 1 0 1 0 0 1 1 0 0 0 0 1 0 1 1 0 0 1 0 0 1 1 0 0 1 1 0 1 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 2227

result:

ok Number of moves = 2227

Test #24:

score: 2
Accepted
time: 22ms
memory: 11056kb

input:

20000 19999 3 0 13716
2443 3550
7226 18881
6724 15050
6146 10096
5988 11062
11837 15312
10744 14005
853 15032
3080 3193
6667 8573
168 10247
16604 18852
16627 18967
6123 6872
8307 18440
9463 17753
12242 15674
5503 12554
9997 15180
4082 9001
11429 19103
7769 12141
13562 16968
4572 15700
254 16337
5235...

output:

0 0 1 1 0 1 0 0 0 0 1 0 1 0 1 0 0 0 1 0 0 1 0 1 0 1 1 0 1 0 1 0 0 1 0 0 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 0 0 0 1 0 0 0 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0 1 0 1 0 1 1 0 1 0 0 1 0 0 0 0 1 1 0 0 0 1 0 0 0 1 0 0 0 1 1 1 1 0 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 0 0 1 1 1 0 0 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 12246

result:

ok Number of moves = 12246

Test #25:

score: 2
Accepted
time: 30ms
memory: 11112kb

input:

20000 19999 3 0 13524
2443 3550
7226 18881
6724 15050
6146 10096
5988 11062
11837 15312
10744 14005
853 15032
3080 3193
6667 8573
168 10247
16604 18852
16627 18967
6123 6872
8307 18440
9463 17753
12242 15674
5503 12554
9997 15180
4082 9001
11429 19103
7769 12141
13562 16968
4572 15700
254 16337
5235...

output:

0 0 1 1 0 1 0 0 0 0 1 0 1 0 1 0 0 0 1 0 0 1 0 1 0 1 1 0 1 0 1 0 0 1 0 0 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 0 0 0 1 0 0 0 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0 1 0 1 0 1 1 0 1 0 0 1 0 0 0 0 1 1 0 0 0 1 0 0 0 1 0 0 0 1 1 1 1 0 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 0 0 1 1 1 0 0 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 12243

result:

ok Number of moves = 12243

Test #26:

score: 2
Accepted
time: 28ms
memory: 10868kb

input:

20000 19999 3 0 1894
2443 3550
7226 18881
6724 15050
6146 10096
5988 11062
11837 15312
10744 14005
853 15032
3080 3193
6667 8573
168 10247
16604 18852
16627 18967
6123 6872
8307 18440
9463 17753
12242 15674
5503 12554
9997 15180
4082 9001
11429 19103
7769 12141
13562 16968
4572 15700
254 16337
5235 ...

output:

0 0 1 1 0 1 0 0 0 0 1 0 1 0 1 0 0 0 1 0 0 1 0 1 0 1 1 0 1 0 1 0 0 1 0 0 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 0 0 0 1 0 0 0 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0 1 0 1 0 1 1 0 1 0 0 1 0 0 0 0 1 1 0 0 0 1 0 0 0 1 0 0 0 1 1 1 1 0 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 0 0 1 1 1 0 0 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 6999

result:

ok Number of moves = 6999

Test #27:

score: 2
Accepted
time: 20ms
memory: 10848kb

input:

20000 19999 3 0 12128
2443 3550
7226 18881
6724 15050
6146 10096
5988 11062
11837 15312
10744 14005
853 15032
3080 3193
6667 8573
168 10247
16604 18852
16627 18967
6123 6872
8307 18440
9463 17753
12242 15674
5503 12554
9997 15180
4082 9001
11429 19103
7769 12141
13562 16968
4572 15700
254 16337
5235...

output:

0 0 1 1 0 1 0 0 0 0 1 0 1 0 1 0 0 0 1 0 0 1 0 1 0 1 1 0 1 0 1 0 0 1 0 0 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 0 0 0 1 0 0 0 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0 1 0 1 0 1 1 0 1 0 0 1 0 0 0 0 1 1 0 0 0 1 0 0 0 1 0 0 0 1 1 1 1 0 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 0 0 1 1 1 0 0 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 7004

result:

ok Number of moves = 7004

Test #28:

score: 2
Accepted
time: 20ms
memory: 10748kb

input:

20000 19999 3 0 10792
2443 3550
7226 18881
6724 15050
6146 10096
5988 11062
11837 15312
10744 14005
853 15032
3080 3193
6667 8573
168 10247
16604 18852
16627 18967
6123 6872
8307 18440
9463 17753
12242 15674
5503 12554
9997 15180
4082 9001
11429 19103
7769 12141
13562 16968
4572 15700
254 16337
5235...

output:

0 0 1 1 0 1 0 0 0 0 1 0 1 0 1 0 0 0 1 0 0 1 0 1 0 1 1 0 1 0 1 0 0 1 0 0 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 0 0 0 1 0 0 0 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0 1 0 1 0 1 1 0 1 0 0 1 0 0 0 0 1 1 0 0 0 1 0 0 0 1 0 0 0 1 1 1 1 0 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 0 0 1 1 1 0 0 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 7009

result:

ok Number of moves = 7009

Test #29:

score: 2
Accepted
time: 18ms
memory: 10888kb

input:

20000 19999 3 0 10624
2443 3550
7226 18881
6724 15050
6146 10096
5988 11062
11837 15312
10744 14005
853 15032
3080 3193
6667 8573
168 10247
16604 18852
16627 18967
6123 6872
8307 18440
9463 17753
12242 15674
5503 12554
9997 15180
4082 9001
11429 19103
7769 12141
13562 16968
4572 15700
254 16337
5235...

output:

0 0 1 1 0 1 0 0 0 0 1 0 1 0 1 0 0 0 1 0 0 1 0 1 0 1 1 0 1 0 1 0 0 1 0 0 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 0 0 0 1 0 0 0 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0 1 0 1 0 1 1 0 1 0 0 1 0 0 0 0 1 1 0 0 0 1 0 0 0 1 0 0 0 1 1 1 1 0 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 0 0 1 1 1 0 0 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 7008

result:

ok Number of moves = 7008

Test #30:

score: 2
Accepted
time: 14ms
memory: 11416kb

input:

20000 19999 3 0 18856
2443 3550
7226 18881
6724 15050
6146 10096
5988 11062
11837 15312
10744 14005
853 15032
3080 3193
6667 8573
168 10247
16604 18852
16627 18967
6123 6872
8307 18440
9463 17753
12242 15674
5503 12554
9997 15180
4082 9001
11429 19103
7769 12141
13562 16968
4572 15700
254 16337
5235...

output:

0 0 1 1 0 1 0 0 0 0 1 0 1 0 1 0 0 0 1 0 0 1 0 1 0 1 1 0 1 0 1 0 0 1 0 0 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 0 0 0 1 0 0 0 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0 1 0 1 0 1 1 0 1 0 0 1 0 0 0 0 1 1 0 0 0 1 0 0 0 1 0 0 0 1 1 1 1 0 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 0 0 1 1 1 0 0 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 13000

result:

ok Number of moves = 13000

Test #31:

score: 2
Accepted
time: 22ms
memory: 11604kb

input:

20000 19999 3 0 2257
2443 3550
7226 18881
6724 15050
6146 10096
5988 11062
11837 15312
10744 14005
853 15032
3080 3193
6667 8573
168 10247
16604 18852
16627 18967
6123 6872
8307 18440
9463 17753
12242 15674
5503 12554
9997 15180
4082 9001
11429 19103
7769 12141
13562 16968
4572 15700
254 16337
5235 ...

output:

0 0 1 1 0 1 0 0 0 0 1 0 1 0 1 0 0 0 1 0 0 1 0 1 0 1 1 0 1 0 1 0 0 1 0 0 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 0 0 0 1 0 0 0 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0 1 0 1 0 1 1 0 1 0 0 1 0 0 0 0 1 1 0 0 0 1 0 0 0 1 0 0 0 1 1 1 1 0 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 0 0 1 1 1 0 0 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 12999

result:

ok Number of moves = 12999

Subtask #4:

score: 9
Accepted

Test #32:

score: 9
Accepted
time: 14ms
memory: 9820kb

input:

17000 20000 3 0 3252
2359 3001
415 5527
1475 15891
8317 15348
4310 7789
15 2479
2514 6838
4492 8286
484 15663
15092 16994
1733 14990
7480 8385
146 6178
723 16279
7172 9638
3167 4833
2140 15556
4588 14172
4827 10341
2227 8025
6236 8222
9308 15099
6500 11300
1531 12027
8714 15298
972 11828
13748 16847...

output:

1 1 1 0 1 1 1 1 1 1 1 1 1 1 0 0 1 0 1 1 1 1 0 1 1 0 0 1 1 1 1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 0 0 0 0 0 1 1 1 1 1 1 0 1 1 1 1 0 1 1 0 1 1 0 0 1 1 1 0 1 0 0 1 1 1 1 1 0 0 1 1 0 1 0 1 1 1 1 1 0 1 0 1 0 1 0 0 0 1 0 1 0 0 1 1 1 0 0 1 1 1 0 0 0 1 1 1 1 2 1 0 0 1 1 1 1 0 1 1 0 0 0 0 0 0 1 1 0 1 0 1 0 1 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 713

result:

ok Number of moves = 713

Test #33:

score: 9
Accepted
time: 14ms
memory: 9812kb

input:

17000 20000 3 0 5322
2359 3001
415 5527
1475 15891
8317 15348
4310 7789
15 2479
2514 6838
4492 8286
484 15663
15092 16994
1733 14990
7480 8385
146 6178
723 16279
7172 9638
3167 4833
2140 15556
4588 14172
4827 10341
2227 8025
6236 8222
9308 15099
6500 11300
1531 12027
8714 15298
972 11828
13748 16847...

output:

1 1 1 0 1 1 1 1 1 1 1 1 1 1 0 0 1 0 1 1 1 1 0 1 1 0 0 1 1 1 1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 0 0 0 0 0 1 1 1 1 1 1 0 1 1 1 1 0 1 1 0 1 1 0 0 1 1 1 0 1 0 0 1 1 1 1 1 0 0 1 1 0 1 0 1 1 1 1 1 0 1 0 1 0 1 0 0 0 1 0 1 0 0 1 1 1 0 0 1 1 1 0 0 0 1 1 1 1 2 1 0 0 1 1 1 1 0 1 1 0 0 0 0 0 0 1 1 0 1 0 1 0 1 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 636

result:

ok Number of moves = 636

Test #34:

score: 9
Accepted
time: 22ms
memory: 9824kb

input:

17000 20000 3 0 8234
1643 6775
9374 10955
3703 6321
10629 14636
3939 8560
391 12508
4793 14716
5224 9429
699 5341
2520 6813
7489 11423
2241 4589
7939 12347
1007 16114
6313 8944
941 7713
3411 13099
7299 8454
1473 11524
59 9042
107 2222
16547 16552
10049 15651
638 9620
11948 16966
3137 14950
3159 1136...

output:

1 0 1 0 1 1 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 1 0 0 0 1 1 0 1 0 0 1 0 0 0 1 1 1 1 0 1 1 0 0 0 1 0 1 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 0 2 0 1 1 1 1 0 1 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 0 0 0 1 1 0 0 0 1 0 0 0 1 0 1 1 0 0 1 0 1 0 0 0 0 1 0 1 0 1 1 0 0 1 0 1 1 0 0 0 1 0 0 1 1 1 0 1 0 1 1 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 2477

result:

ok Number of moves = 2477

Test #35:

score: 9
Accepted
time: 6ms
memory: 9744kb

input:

17000 20000 3 0 5688
1643 6775
9374 10955
3703 6321
10629 14636
3939 8560
391 12508
4793 14716
5224 9429
699 5341
2520 6813
7489 11423
2241 4589
7939 12347
1007 16114
6313 8944
941 7713
3411 13099
7299 8454
1473 11524
59 9042
107 2222
16547 16552
10049 15651
638 9620
11948 16966
3137 14950
3159 1136...

output:

1 0 1 0 1 1 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 1 0 0 0 1 1 0 1 0 0 1 0 0 0 1 1 1 1 0 1 1 0 0 0 1 0 1 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 0 2 0 1 1 1 1 0 1 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 0 0 0 1 1 0 0 0 1 0 0 0 1 0 1 1 0 0 1 0 1 0 0 0 0 1 0 1 0 1 1 0 0 1 0 1 1 0 0 0 1 0 0 1 1 1 0 1 0 1 1 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 1511

result:

ok Number of moves = 1511

Test #36:

score: 9
Accepted
time: 26ms
memory: 10556kb

input:

17000 20000 3 0 2189
198 407
7963 9285
7935 16583
6975 15222
156 12638
4761 9002
2013 11879
13655 14150
13760 15662
8763 11686
12349 16602
1210 16269
8492 14369
3406 5647
2977 7023
13987 15855
5916 14670
4056 6317
1038 11564
3433 9479
9231 12619
5497 9047
10609 12729
1797 6630
5985 14772
4690 10066
...

output:

1 1 1 0 0 1 0 0 0 0 0 0 1 1 1 0 1 1 1 1 1 0 1 1 0 1 1 0 0 1 1 0 1 0 0 0 0 1 0 1 1 0 1 1 0 0 0 1 0 0 0 1 0 1 1 0 1 0 1 1 1 0 1 0 1 1 0 1 0 0 1 0 0 1 0 0 0 1 1 0 1 0 1 1 1 0 0 1 1 1 0 1 1 0 1 0 1 1 1 0 0 1 0 0 0 1 0 1 0 1 1 1 0 1 0 0 0 1 0 1 0 0 1 1 1 1 0 0 1 1 0 0 0 0 1 0 1 1 1 0 0 1 1 1 1 0 1 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 9597

result:

ok Number of moves = 9597

Test #37:

score: 9
Accepted
time: 18ms
memory: 10056kb

input:

17000 20000 3 0 13008
198 407
7963 9285
7935 16583
6975 15222
156 12638
4761 9002
2013 11879
13655 14150
13760 15662
8763 11686
12349 16602
1210 16269
8492 14369
3406 5647
2977 7023
13987 15855
5916 14670
4056 6317
1038 11564
3433 9479
9231 12619
5497 9047
10609 12729
1797 6630
5985 14772
4690 10066...

output:

1 1 1 0 0 1 0 0 0 0 0 0 1 1 1 0 1 1 1 1 1 0 1 1 0 1 1 0 0 1 1 0 1 0 0 0 0 1 0 1 1 0 1 1 0 0 0 1 0 0 0 1 0 1 1 0 1 0 1 1 1 0 1 0 1 1 0 1 0 0 1 0 0 1 0 0 0 1 1 0 1 0 1 1 1 0 0 1 1 1 0 1 1 0 1 0 1 1 1 0 0 1 0 0 0 1 0 1 0 1 1 1 0 1 0 0 0 1 0 1 0 0 1 1 1 1 0 0 1 1 0 0 0 0 1 0 1 1 1 0 0 1 1 1 1 0 1 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 4089

result:

ok Number of moves = 4089

Test #38:

score: 9
Accepted
time: 20ms
memory: 11052kb

input:

20000 20000 3 0 9802
8195 11018
4934 8418
8736 14416
11417 17429
476 19740
692 4604
1198 6384
10136 17716
4632 13854
3740 12685
3431 15532
2060 5415
4701 6708
3071 17438
12747 14213
13652 14058
14633 18368
703 923
9617 13666
9348 16762
7487 16462
15460 19242
2801 2958
9116 10070
8970 19335
4252 1617...

output:

0 0 0 1 1 0 1 1 1 0 0 0 1 1 0 1 1 1 1 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0 1 1 0 1 0 1 1 1 0 1 0 0 0 1 0 0 0 1 0 1 1 0 0 0 1 1 0 1 0 0 0 1 0 0 0 1 0 0 0 1 1 0 0 1 0 0 1 1 0 0 1 0 1 0 1 1 0 1 0 0 1 0 1 1 1 0 1 0 0 0 1 1 1 0 1 1 1 0 1 0 1 1 0 1 0 1 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 0 1 1 1 1 0 1 0 1 0 1 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 10004

result:

ok Number of moves = 10004

Test #39:

score: 9
Accepted
time: 22ms
memory: 9960kb

input:

17000 20000 3 0 7845
5583 8863
3589 6242
7312 11080
12117 16234
5653 7745
13049 15467
3440 12765
3291 11440
2682 6794
10169 15080
2032 15543
7153 16919
1929 3798
2077 9466
1562 15895
1359 5725
13719 16462
7519 15243
1131 9146
4708 7647
3581 11604
2807 12817
4 14606
13121 13465
174 15619
965 5750
131...

output:

1 1 0 1 0 1 1 1 1 1 0 0 0 0 0 0 1 1 0 1 0 0 1 0 1 1 0 0 0 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 0 1 1 1 1 1 1 1 0 1 1 0 0 0 0 0 1 1 1 0 0 1 0 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 1 1 0 1 1 1 1 0 1 0 1 1 0 1 0 0 0 1 0 0 1 1 1 1 0 0 1 1 0 1 1 0 1 1 1 0 0 1 1 0 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 2048

result:

ok Number of moves = 2048

Test #40:

score: 9
Accepted
time: 14ms
memory: 9792kb

input:

17000 20000 3 0 8507
5583 8863
3589 6242
7312 11080
12117 16234
5653 7745
13049 15467
3440 12765
3291 11440
2682 6794
10169 15080
2032 15543
7153 16919
1929 3798
2077 9466
1562 15895
1359 5725
13719 16462
7519 15243
1131 9146
4708 7647
3581 11604
2807 12817
4 14606
13121 13465
174 15619
965 5750
131...

output:

1 1 0 1 0 1 1 1 1 1 0 0 0 0 0 0 1 1 0 1 0 0 1 0 1 1 0 0 0 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 0 1 1 1 1 1 1 1 0 1 1 0 0 0 0 0 1 1 1 0 0 1 0 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 1 1 0 1 1 1 1 0 1 0 1 1 0 1 0 0 0 1 0 0 1 1 1 1 0 0 1 1 0 1 1 0 1 1 1 0 0 1 1 0 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 2458

result:

ok Number of moves = 2458

Subtask #5:

score: 5
Accepted

Test #41:

score: 5
Accepted
time: 0ms
memory: 4464kb

input:

500 499 2 1000 58
245 290
162 175
30 92
239 365
174 270
83 424
240 343
72 141
3 474
31 187
128 356
92 100
76 499
174 225
139 197
65 168
167 456
384 429
239 344
370 495
157 231
0 163
164 236
155 426
200 436
133 304
259 441
119 279
33 202
108 159
198 371
158 417
107 139
327 357
68 165
90 148
174 300
0...

output:

0 0 0 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 0 0 1 0 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 0 1 0 0 0 0 0 1 1 1 1 1 0 1 1 1 1 1 1 0 0 1 1 0 1 0 1 1 1 1 1 1 0 0 1 1 1 1 0 1 1 1 1 1 1 0 0 1 0 1 1 0 1 1 1 0 0 0 1 1 0 1 0 1 1 1 0 1 0 1 0 1 1 1 1 0 1 0 1 1 1 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 6

result:

ok Number of moves = 6

Test #42:

score: 5
Accepted
time: 2ms
memory: 4632kb

input:

6 5 2 12 2
3 5
2 4
1 2
0 5
2 3

output:

1 1 1 1 0 

input:

Interaction has been finished!

output:

Number of moves = 3

result:

ok Number of moves = 3

Test #43:

score: 5
Accepted
time: 2ms
memory: 4760kb

input:

500 499 2 1000 143
143 436
0 42
143 243
143 332
143 159
143 245
0 248
0 306
38 143
0 491
0 37
143 420
0 400
0 407
0 122
0 123
143 217
143 304
143 453
0 179
46 143
143 338
0 448
0 321
82 143
143 151
0 204
143 363
0 412
0 121
143 437
0 137
0 431
21 143
143 250
143 378
143 205
92 143
143 233
26 143
0 2...

output:

0 1 0 0 0 0 1 1 0 1 1 0 1 1 1 1 0 0 0 1 0 0 1 1 0 0 1 0 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 1 0 0 0 0 0 1 0 0 0 1 1 0 1 1 0 1 0 0 1 1 0 0 1 0 0 0 0 1 1 0 1 0 1 0 1 0 0 1 0 0 1 0 0 0 0 0 0 1 1 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 1 1 1 0 1 0 1 0 1 0 0 0 0 1 1 1 1 1 0 0 1 0 1 1 0 0 1 0 1 0 0 1 1 1 0 1 0 1 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 1

result:

ok Number of moves = 1

Test #44:

score: 5
Accepted
time: 0ms
memory: 4788kb

input:

499 498 2 998 204
10 450
377 381
235 416
67 160
34 315
46 469
3 7
108 360
196 295
222 470
78 310
19 94
16 376
131 387
60 70
135 198
287 310
142 482
127 265
303 392
81 285
353 395
257 268
39 162
110 347
261 403
234 352
426 476
44 162
244 348
250 363
176 411
25 85
95 492
392 488
465 494
83 445
381 455...

output:

1 1 1 1 0 0 1 1 0 1 1 0 1 0 0 0 0 1 1 1 1 1 1 0 1 1 1 0 1 1 0 0 0 1 0 0 1 0 1 0 0 0 1 1 1 0 1 0 1 1 0 0 0 0 0 1 0 1 1 1 1 0 1 1 0 1 1 1 1 0 1 0 1 0 0 1 0 1 0 1 0 0 0 0 1 0 1 1 1 1 0 1 1 0 1 0 0 0 1 0 0 1 1 1 1 1 1 0 0 1 0 1 1 0 0 0 1 0 0 1 1 0 1 1 1 0 0 1 0 1 1 1 0 1 0 0 1 1 1 0 0 1 1 0 0 0 0 1 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 498

result:

ok Number of moves = 498

Test #45:

score: 5
Accepted
time: 2ms
memory: 4468kb

input:

500 499 2 1000 286
322 418
232 242
51 152
409 435
124 486
14 290
324 414
352 385
310 435
177 227
147 327
56 407
53 241
473 493
27 373
319 378
349 388
205 241
400 445
354 375
266 480
75 195
208 325
306 467
15 32
43 430
238 485
104 391
100 484
40 389
166 225
198 209
405 432
27 260
357 472
99 158
225 3...

output:

1 0 0 1 0 1 0 0 1 0 1 1 1 0 1 1 1 1 0 0 1 1 0 1 1 0 1 1 0 1 0 0 0 0 1 1 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 1 0 1 0 0 1 1 0 1 0 1 1 1 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 1 1 0 1 1 0 1 0 0 1 1 0 0 1 1 0 0 1 0 0 0 1 1 1 0 1 1 1 1 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 0 0 0 0 1 1 1 1 0 1 0 0 1 1 1 1 0 1 0 1 1 1 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 499

result:

ok Number of moves = 499

Test #46:

score: 5
Accepted
time: 2ms
memory: 4500kb

input:

500 499 2 1000 455
322 418
232 242
51 152
409 435
124 486
14 290
324 414
352 385
310 435
177 227
147 327
56 407
53 241
473 493
27 373
319 378
349 388
205 241
400 445
354 375
266 480
75 195
208 325
306 467
15 32
43 430
238 485
104 391
100 484
40 389
166 225
198 209
405 432
27 260
357 472
99 158
225 3...

output:

1 0 0 1 0 1 0 0 1 0 1 1 1 0 1 1 1 1 0 0 1 1 0 1 1 0 1 1 0 1 0 0 0 0 1 1 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 1 0 1 0 0 1 1 0 1 0 1 1 1 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 1 1 0 1 1 0 1 0 0 1 1 0 0 1 1 0 0 1 0 0 0 1 1 1 0 1 1 1 1 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 0 0 0 0 1 1 1 1 0 1 0 0 1 1 1 1 0 1 0 1 1 1 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 500

result:

ok Number of moves = 500

Test #47:

score: 5
Accepted
time: 2ms
memory: 4576kb

input:

500 499 2 1000 149
322 418
232 242
51 152
409 435
124 486
14 290
324 414
352 385
310 435
177 227
147 327
56 407
53 241
473 493
27 373
319 378
349 388
205 241
400 445
354 375
266 480
75 195
208 325
306 467
15 32
43 430
238 485
104 391
100 484
40 389
166 225
198 209
405 432
27 260
357 472
99 158
225 3...

output:

1 0 0 1 0 1 0 0 1 0 1 1 1 0 1 1 1 1 0 0 1 1 0 1 1 0 1 1 0 1 0 0 0 0 1 1 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 1 0 1 0 0 1 1 0 1 0 1 1 1 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 1 1 0 1 1 0 1 0 0 1 1 0 0 1 1 0 0 1 0 0 0 1 1 1 0 1 1 1 1 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 0 0 0 0 1 1 1 1 0 1 0 0 1 1 1 1 0 1 0 1 1 1 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 501

result:

ok Number of moves = 501

Test #48:

score: 5
Accepted
time: 2ms
memory: 4800kb

input:

500 499 2 1000 246
322 418
232 242
51 152
409 435
124 486
14 290
324 414
352 385
310 435
177 227
147 327
56 407
53 241
473 493
27 373
319 378
349 388
205 241
400 445
354 375
266 480
75 195
208 325
306 467
15 32
43 430
238 485
104 391
100 484
40 389
166 225
198 209
405 432
27 260
357 472
99 158
225 3...

output:

1 0 0 1 0 1 0 0 1 0 1 1 1 0 1 1 1 1 0 0 1 1 0 1 1 0 1 1 0 1 0 0 0 0 1 1 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 1 0 1 0 0 1 1 0 1 0 1 1 1 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 1 1 0 1 1 0 1 0 0 1 1 0 0 1 1 0 0 1 0 0 0 1 1 1 0 1 1 1 1 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 0 0 0 0 1 1 1 1 0 1 0 0 1 1 1 1 0 1 0 1 1 1 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 496

result:

ok Number of moves = 496

Test #49:

score: 5
Accepted
time: 2ms
memory: 4532kb

input:

500 499 2 1000 309
322 418
232 242
51 152
409 435
124 486
14 290
324 414
352 385
310 435
177 227
147 327
56 407
53 241
473 493
27 373
319 378
349 388
205 241
400 445
354 375
266 480
75 195
208 325
306 467
15 32
43 430
238 485
104 391
100 484
40 389
166 225
198 209
405 432
27 260
357 472
99 158
225 3...

output:

1 0 0 1 0 1 0 0 1 0 1 1 1 0 1 1 1 1 0 0 1 1 0 1 1 0 1 1 0 1 0 0 0 0 1 1 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 1 0 1 0 0 1 1 0 1 0 1 1 1 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 1 1 0 1 1 0 1 0 0 1 1 0 0 1 1 0 0 1 0 0 0 1 1 1 0 1 1 1 1 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 0 0 0 0 1 1 1 1 0 1 0 0 1 1 1 1 0 1 0 1 1 1 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 499

result:

ok Number of moves = 499

Test #50:

score: 5
Accepted
time: 2ms
memory: 4584kb

input:

500 499 2 1000 438
322 418
232 242
51 152
409 435
124 486
14 290
324 414
352 385
310 435
177 227
147 327
56 407
53 241
473 493
27 373
319 378
349 388
205 241
400 445
354 375
266 480
75 195
208 325
306 467
15 32
43 430
238 485
104 391
100 484
40 389
166 225
198 209
405 432
27 260
357 472
99 158
225 3...

output:

1 0 0 1 0 1 0 0 1 0 1 1 1 0 1 1 1 1 0 0 1 1 0 1 1 0 1 1 0 1 0 0 0 0 1 1 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 1 0 1 0 0 1 1 0 1 0 1 1 1 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 1 1 0 1 1 0 1 0 0 1 1 0 0 1 1 0 0 1 0 0 0 1 1 1 0 1 1 1 1 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 0 0 0 0 1 1 1 1 0 1 0 0 1 1 1 1 0 1 0 1 1 1 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 494

result:

ok Number of moves = 494

Test #51:

score: 5
Accepted
time: 2ms
memory: 4536kb

input:

500 499 2 1000 11
322 418
232 242
51 152
409 435
124 486
14 290
324 414
352 385
310 435
177 227
147 327
56 407
53 241
473 493
27 373
319 378
349 388
205 241
400 445
354 375
266 480
75 195
208 325
306 467
15 32
43 430
238 485
104 391
100 484
40 389
166 225
198 209
405 432
27 260
357 472
99 158
225 35...

output:

1 0 0 1 0 1 0 0 1 0 1 1 1 0 1 1 1 1 0 0 1 1 0 1 1 0 1 1 0 1 0 0 0 0 1 1 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 1 0 1 0 0 1 1 0 1 0 1 1 1 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 1 0 1 1 1 0 1 1 0 1 0 0 1 1 0 0 1 1 0 0 1 0 0 0 1 1 1 0 1 1 1 1 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 0 0 0 0 1 1 1 1 0 1 0 0 1 1 1 1 0 1 0 1 1 1 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 5

result:

ok Number of moves = 5

Test #52:

score: 5
Accepted
time: 0ms
memory: 4772kb

input:

498 497 2 996 45
412 437
143 281
148 269
403 427
317 365
318 432
400 457
80 491
68 316
162 224
48 124
210 329
307 363
109 139
4 427
314 433
139 174
51 160
14 402
154 188
11 155
5 323
251 377
165 166
273 395
398 476
163 472
20 380
338 354
303 311
55 318
170 262
211 446
215 242
60 77
124 260
143 230
7...

output:

0 0 1 0 1 0 1 0 1 1 1 0 1 0 1 1 0 0 1 1 1 1 1 1 1 0 1 1 0 0 1 0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 0 1 0 0 1 0 0 0 1 1 0 0 1 1 0 0 1 1 1 1 0 1 1 0 1 0 1 1 0 0 1 1 0 1 1 1 0 1 1 1 0 1 0 1 0 0 0 0 1 0 1 0 0 1 1 0 0 0 0 1 1 0 0 0 1 0 1 1 0 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 0 1 1 1 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 146

result:

ok Number of moves = 146

Test #53:

score: 5
Accepted
time: 0ms
memory: 4540kb

input:

498 497 2 996 426
412 437
143 281
148 269
403 427
317 365
318 432
400 457
80 491
68 316
162 224
48 124
210 329
307 363
109 139
4 427
314 433
139 174
51 160
14 402
154 188
11 155
5 323
251 377
165 166
273 395
398 476
163 472
20 380
338 354
303 311
55 318
170 262
211 446
215 242
60 77
124 260
143 230
...

output:

0 0 1 0 1 0 1 0 1 1 1 0 1 0 1 1 0 0 1 1 1 1 1 1 1 0 1 1 0 0 1 0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 0 1 0 0 1 0 0 0 1 1 0 0 1 1 0 0 1 1 1 1 0 1 1 0 1 0 1 1 0 0 1 1 0 1 1 1 0 1 1 1 0 1 0 1 0 0 0 0 1 0 1 0 0 1 1 0 0 0 0 1 1 0 0 0 1 0 1 1 0 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 0 1 1 1 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 143

result:

ok Number of moves = 143

Test #54:

score: 5
Accepted
time: 2ms
memory: 4740kb

input:

500 499 2 1000 106
258 310
108 330
140 329
260 447
142 415
32 493
476 480
99 108
71 383
229 375
255 460
124 344
134 472
13 218
137 390
97 236
126 141
108 391
108 467
240 484
2 86
343 393
45 214
196 337
73 108
91 374
65 436
103 233
121 396
108 425
348 430
318 448
13 24
219 326
44 216
8 256
213 464
16...

output:

1 1 0 0 1 1 1 1 1 0 0 1 1 0 1 1 1 1 1 1 0 1 1 0 1 0 0 0 0 1 0 1 0 1 1 1 1 0 1 1 1 0 0 0 1 1 1 0 0 1 1 1 1 0 0 1 1 1 0 0 1 0 1 1 1 1 1 0 0 0 1 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 0 0 1 1 0 1 1 0 0 1 1 1 1 1 1 1 1 0 1 1 0 0 1 1 0 0 1 0 0 1 0 0 0 1 1 0 1 1 1 1 0 1 1 0 1 1 1 1 0 1 1 1 1 0 0 1 0 1 0 1 1 1 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 113

result:

ok Number of moves = 113

Test #55:

score: 5
Accepted
time: 2ms
memory: 4776kb

input:

500 499 2 1000 25
258 310
108 330
140 329
260 447
142 415
32 493
476 480
99 108
71 383
229 375
255 460
124 344
134 472
13 218
137 390
97 236
126 141
108 391
108 467
240 484
2 86
343 393
45 214
196 337
73 108
91 374
65 436
103 233
121 396
108 425
348 430
318 448
13 24
219 326
44 216
8 256
213 464
160...

output:

1 1 0 0 1 1 1 1 1 0 0 1 1 0 1 1 1 1 1 1 0 1 1 0 1 0 0 0 0 1 0 1 0 1 1 1 1 0 1 1 1 0 0 0 1 1 1 0 0 1 1 1 1 0 0 1 1 1 0 0 1 0 1 1 1 1 1 0 0 0 1 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 0 0 1 1 0 1 1 0 0 1 1 1 1 1 1 1 1 0 1 1 0 0 1 1 0 0 1 0 0 1 0 0 0 1 1 0 1 1 1 1 0 1 1 0 1 1 1 1 0 1 1 1 1 0 0 1 0 1 0 1 1 1 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 210

result:

ok Number of moves = 210

Test #56:

score: 5
Accepted
time: 0ms
memory: 4480kb

input:

500 499 2 1000 144
417 449
288 401
185 278
21 272
188 455
40 478
141 450
155 229
113 462
54 250
162 333
50 135
121 363
207 271
330 434
334 462
103 252
4 373
434 494
40 59
127 170
111 146
330 369
344 483
332 460
141 263
93 220
45 445
338 398
110 185
104 361
93 214
237 401
150 405
427 437
414 493
220 ...

output:

0 1 0 0 1 0 1 0 1 0 1 1 1 0 0 0 1 0 1 1 1 0 0 1 0 1 1 1 1 0 0 0 1 0 0 1 1 0 1 1 1 1 0 0 1 1 0 0 1 0 0 0 1 0 1 0 1 1 0 0 0 1 0 1 1 0 0 0 1 1 1 1 1 0 1 0 1 1 1 0 1 0 1 1 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 1 1 0 1 0 1 0 0 0 0 0 0 1 0 1 1 0 0 0 0 1 1 0 0 1 0 1 1 0 0 1 1 1 0 1 0 1 1 0 0 1 1 1 1 0 1 0 0 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 126

result:

ok Number of moves = 126

Test #57:

score: 5
Accepted
time: 2ms
memory: 4452kb

input:

500 499 2 1000 238
417 449
288 401
185 278
21 272
188 455
40 478
141 450
155 229
113 462
54 250
162 333
50 135
121 363
207 271
330 434
334 462
103 252
4 373
434 494
40 59
127 170
111 146
330 369
344 483
332 460
141 263
93 220
45 445
338 398
110 185
104 361
93 214
237 401
150 405
427 437
414 493
220 ...

output:

0 1 0 0 1 0 1 0 1 0 1 1 1 0 0 0 1 0 1 1 1 0 0 1 0 1 1 1 1 0 0 0 1 0 0 1 1 0 1 1 1 1 0 0 1 1 0 0 1 0 0 0 1 0 1 0 1 1 0 0 0 1 0 1 1 0 0 0 1 1 1 1 1 0 1 0 1 1 1 0 1 0 1 1 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 1 1 0 1 0 1 0 0 0 0 0 0 1 0 1 1 0 0 0 0 1 1 0 0 1 0 1 1 0 0 1 1 1 0 1 0 1 1 0 0 1 1 1 1 0 1 0 0 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 140

result:

ok Number of moves = 140

Test #58:

score: 5
Accepted
time: 2ms
memory: 4764kb

input:

500 499 2 1000 164
417 449
288 401
185 278
21 272
188 455
40 478
141 450
155 229
113 462
54 250
162 333
50 135
121 363
207 271
330 434
334 462
103 252
4 373
434 494
40 59
127 170
111 146
330 369
344 483
332 460
141 263
93 220
45 445
338 398
110 185
104 361
93 214
237 401
150 405
427 437
414 493
220 ...

output:

0 1 0 0 1 0 1 0 1 0 1 1 1 0 0 0 1 0 1 1 1 0 0 1 0 1 1 1 1 0 0 0 1 0 0 1 1 0 1 1 1 1 0 0 1 1 0 0 1 0 0 0 1 0 1 0 1 1 0 0 0 1 0 1 1 0 0 0 1 1 1 1 1 0 1 0 1 1 1 0 1 0 1 1 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 1 1 0 1 0 1 0 0 0 0 0 0 1 0 1 1 0 0 0 0 1 1 0 0 1 0 1 1 0 0 1 1 1 0 1 0 1 1 0 0 1 1 1 1 0 1 0 0 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 137

result:

ok Number of moves = 137

Test #59:

score: 5
Accepted
time: 2ms
memory: 4472kb

input:

500 499 2 1000 413
417 449
288 401
185 278
21 272
188 455
40 478
141 450
155 229
113 462
54 250
162 333
50 135
121 363
207 271
330 434
334 462
103 252
4 373
434 494
40 59
127 170
111 146
330 369
344 483
332 460
141 263
93 220
45 445
338 398
110 185
104 361
93 214
237 401
150 405
427 437
414 493
220 ...

output:

0 1 0 0 1 0 1 0 1 0 1 1 1 0 0 0 1 0 1 1 1 0 0 1 0 1 1 1 1 0 0 0 1 0 0 1 1 0 1 1 1 1 0 0 1 1 0 0 1 0 0 0 1 0 1 0 1 1 0 0 0 1 0 1 1 0 0 0 1 1 1 1 1 0 1 0 1 1 1 0 1 0 1 1 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 1 1 0 1 0 1 0 0 0 0 0 0 1 0 1 1 0 0 0 0 1 1 0 0 1 0 1 1 0 0 1 1 1 0 1 0 1 1 0 0 1 1 1 1 0 1 0 0 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 140

result:

ok Number of moves = 140

Test #60:

score: 5
Accepted
time: 2ms
memory: 4512kb

input:

500 499 2 1000 245
417 449
288 401
185 278
21 272
188 455
40 478
141 450
155 229
113 462
54 250
162 333
50 135
121 363
207 271
330 434
334 462
103 252
4 373
434 494
40 59
127 170
111 146
330 369
344 483
332 460
141 263
93 220
45 445
338 398
110 185
104 361
93 214
237 401
150 405
427 437
414 493
220 ...

output:

0 1 0 0 1 0 1 0 1 0 1 1 1 0 0 0 1 0 1 1 1 0 0 1 0 1 1 1 1 0 0 0 1 0 0 1 1 0 1 1 1 1 0 0 1 1 0 0 1 0 0 0 1 0 1 0 1 1 0 0 0 1 0 1 1 0 0 0 1 1 1 1 1 0 1 0 1 1 1 0 1 0 1 1 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 1 1 0 1 0 1 0 0 0 0 0 0 1 0 1 1 0 0 0 0 1 1 0 0 1 0 1 1 0 0 1 1 1 0 1 0 1 1 0 0 1 1 1 1 0 1 0 0 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 88

result:

ok Number of moves = 88

Test #61:

score: 5
Accepted
time: 2ms
memory: 4544kb

input:

498 497 2 996 139
64 413
222 260
222 236
333 416
117 447
256 447
175 203
239 319
109 369
78 343
145 206
143 341
211 319
69 151
332 339
66 434
252 456
88 92
185 274
302 395
149 374
201 369
40 205
19 69
175 446
92 171
15 28
93 395
60 424
281 409
81 459
102 240
154 393
371 447
311 489
73 300
83 456
24 ...

output:

1 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 1 1 1 1 0 0 1 1 1 1 1 1 0 1 1 0 0 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 1 0 0 0 1 1 1 1 1 0 1 0 0 1 1 0 0 1 0 1 1 1 1 1 0 1 0 0 0 1 1 0 1 1 0 0 1 0 0 0 0 0 1 1 1 0 1 1 1 1 0 1 0 0 0 0 1 1 1 0 0 0 0 1 0 1 0 1 0 1 0 1 1 1 1 1 0 0 0 0 1 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 94

result:

ok Number of moves = 94

Test #62:

score: 5
Accepted
time: 2ms
memory: 4536kb

input:

498 497 2 996 349
64 413
222 260
222 236
333 416
117 447
256 447
175 203
239 319
109 369
78 343
145 206
143 341
211 319
69 151
332 339
66 434
252 456
88 92
185 274
302 395
149 374
201 369
40 205
19 69
175 446
92 171
15 28
93 395
60 424
281 409
81 459
102 240
154 393
371 447
311 489
73 300
83 456
24 ...

output:

1 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 1 1 1 1 0 0 1 1 1 1 1 1 0 1 1 0 0 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 1 0 0 0 1 1 1 1 1 0 1 0 0 1 1 0 0 1 0 1 1 1 1 1 0 1 0 0 0 1 1 0 1 1 0 0 1 0 0 0 0 0 1 1 1 0 1 1 1 1 0 1 0 0 0 0 1 1 1 0 0 0 0 1 0 1 0 1 0 1 0 1 1 1 1 1 0 0 0 0 1 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 96

result:

ok Number of moves = 96

Test #63:

score: 5
Accepted
time: 0ms
memory: 4472kb

input:

498 497 2 996 273
64 413
222 260
222 236
333 416
117 447
256 447
175 203
239 319
109 369
78 343
145 206
143 341
211 319
69 151
332 339
66 434
252 456
88 92
185 274
302 395
149 374
201 369
40 205
19 69
175 446
92 171
15 28
93 395
60 424
281 409
81 459
102 240
154 393
371 447
311 489
73 300
83 456
24 ...

output:

1 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 1 1 1 1 0 0 1 1 1 1 1 1 0 1 1 0 0 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 1 0 0 0 1 1 1 1 1 0 1 0 0 1 1 0 0 1 0 1 1 1 1 1 0 1 0 0 0 1 1 0 1 1 0 0 1 0 0 0 0 0 1 1 1 0 1 1 1 1 0 1 0 0 0 0 1 1 1 0 0 0 0 1 0 1 0 1 0 1 0 1 1 1 1 1 0 0 0 0 1 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 95

result:

ok Number of moves = 95

Test #64:

score: 5
Accepted
time: 2ms
memory: 4772kb

input:

498 497 2 996 469
64 413
222 260
222 236
333 416
117 447
256 447
175 203
239 319
109 369
78 343
145 206
143 341
211 319
69 151
332 339
66 434
252 456
88 92
185 274
302 395
149 374
201 369
40 205
19 69
175 446
92 171
15 28
93 395
60 424
281 409
81 459
102 240
154 393
371 447
311 489
73 300
83 456
24 ...

output:

1 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 1 1 1 1 0 0 1 1 1 1 1 1 0 1 1 0 0 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 1 0 0 0 1 1 1 1 1 0 1 0 0 1 1 0 0 1 0 1 1 1 1 1 0 1 0 0 0 1 1 0 1 1 0 0 1 0 0 0 0 0 1 1 1 0 1 1 1 1 0 1 0 0 0 0 1 1 1 0 0 0 0 1 0 1 0 1 0 1 0 1 1 1 1 1 0 0 0 0 1 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 105

result:

ok Number of moves = 105

Test #65:

score: 5
Accepted
time: 2ms
memory: 4552kb

input:

499 498 2 998 193
193 349
155 299
127 290
179 465
69 286
376 491
128 394
346 457
165 419
64 127
390 498
173 405
64 492
371 487
120 193
81 366
77 166
266 486
273 489
2 157
104 446
129 251
307 481
109 290
97 456
78 490
173 455
236 486
164 348
316 375
85 182
52 485
178 397
56 86
75 351
276 337
88 224
9...

output:

1 1 1 0 1 0 1 1 1 1 1 0 1 1 0 1 0 1 1 1 1 1 0 0 1 1 0 0 1 0 1 0 0 1 0 1 1 1 0 1 1 0 0 0 0 0 0 0 0 1 1 0 1 0 0 1 1 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 0 1 0 1 1 1 0 1 1 1 0 0 1 0 0 1 1 1 0 1 0 1 1 1 0 0 0 1 0 1 0 1 1 1 1 0 0 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0 0 0 0 0 0 1 0 0 1 1 1 1 1 1 0 1 1 1 1 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 94

result:

ok Number of moves = 94

Test #66:

score: 5
Accepted
time: 2ms
memory: 4768kb

input:

499 498 2 998 309
165 393
258 436
388 451
337 460
232 278
308 424
34 249
331 335
116 195
306 496
68 260
388 453
260 342
161 490
35 436
85 422
151 426
37 181
90 442
73 273
202 385
399 413
212 269
165 469
142 257
58 365
55 258
47 311
87 97
404 417
6 359
259 489
165 196
357 492
41 147
208 448
63 243
40...

output:

0 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1 1 0 1 1 0 0 0 1 0 0 1 1 0 1 0 0 0 1 1 1 1 0 1 1 1 0 0 0 1 0 1 0 1 0 0 0 0 0 0 1 0 1 1 1 1 1 1 0 0 1 0 1 1 1 1 0 0 1 0 0 0 1 1 1 1 1 0 1 0 1 1 1 0 0 1 1 0 0 0 1 1 0 1 1 0 1 0 0 0 0 1 1 0 1 0 0 1 0 0 1 0 1 0 0 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 1 0 1 0 1 1 0 1 1 0 1 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 102

result:

ok Number of moves = 102

Test #67:

score: 5
Accepted
time: 2ms
memory: 4556kb

input:

499 498 2 998 481
230 264
58 261
324 391
34 126
93 382
43 273
412 469
100 497
31 496
382 449
426 482
191 399
437 465
258 440
21 108
30 410
292 404
19 422
73 190
195 388
290 386
28 375
57 481
1 364
5 181
83 382
437 462
68 423
328 450
161 307
258 480
10 266
76 190
438 472
133 220
61 80
183 186
261 334...

output:

0 0 1 0 1 0 0 0 0 1 0 1 0 1 1 0 1 1 1 0 1 1 0 1 0 0 1 0 0 1 0 0 1 1 0 0 1 1 0 1 1 0 1 0 1 1 0 1 0 1 1 0 0 0 1 0 1 1 0 0 0 1 1 1 1 0 0 1 1 0 1 0 0 0 0 0 1 0 1 1 0 1 1 0 0 1 0 0 0 0 1 1 1 1 1 1 1 0 1 0 0 1 0 1 1 1 0 1 1 1 0 1 0 1 1 0 1 1 0 1 0 1 1 1 1 0 1 1 1 1 0 0 0 1 1 0 0 1 1 1 1 1 0 0 1 1 1 0 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 103

result:

ok Number of moves = 103

Test #68:

score: 5
Accepted
time: 2ms
memory: 4476kb

input:

499 498 2 998 480
224 480
277 429
278 462
144 302
216 246
117 255
243 377
313 356
127 181
292 339
165 235
141 191
355 431
468 495
389 444
188 289
335 461
31 444
76 274
1 345
24 266
67 472
268 310
222 473
226 383
154 268
99 210
357 404
52 293
53 186
19 31
157 363
165 315
3 420
33 241
143 185
124 210
...

output:

1 0 0 0 0 1 1 1 0 0 1 0 1 0 1 1 1 0 1 1 1 0 1 0 1 1 0 1 0 1 0 0 1 1 1 1 0 1 0 0 1 0 1 1 1 0 1 1 1 0 1 1 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 1 1 0 1 1 0 0 1 1 1 0 0 0 1 0 1 1 0 1 0 0 1 1 1 0 0 0 0 1 0 0 1 0 1 1 1 1 0 1 0 0 1 1 0 0 1 1 1 1 0 0 0 0 1 1 0 1 1 1 1 1 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1 0 0 1 1 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 103

result:

ok Number of moves = 103

Subtask #6:

score: 71
Accepted

Test #69:

score: 71
Accepted
time: 0ms
memory: 9204kb

input:

20000 19999 2 12 18478
5245 8728
2144 5219
16087 17623
16037 17821
1333 1523
6983 7616
8223 10814
6953 18933
9487 12057
5266 17099
4628 14074
13345 16201
4663 16298
11086 17418
9448 13719
623 7016
4569 7750
12603 19679
10508 15041
2003 19218
8935 12640
12167 18714
13762 15878
2264 19638
17971 19220
...

output:

0 0 1 0 1 0 1 0 1 1 0 0 1 1 1 0 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1 0 0 1 1 1 1 0 0 1 0 0 0 0 1 0 1 1 0 1 1 1 1 1 0 0 0 1 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 1 1 0 1 1 1 1 1 1 1 1 1 0 0 0 1 0 0 1 0 1 0 0 1 0 1 0 1 0 0 0 1 0 0 1 1 0 0 1 1 1 1 1 0 1 1 0 1 0 0 0 1 0 0 1 1 0 1 0 1 1 0 0 0 1 1 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 73

result:

ok Number of moves = 73

Test #70:

score: 71
Accepted
time: 12ms
memory: 9828kb

input:

20000 19999 2 12 15535
14233 19823
3671 14519
4101 19782
655 18577
9057 14995
10360 19430
10922 19309
5046 18443
11133 16830
15377 16400
927 11030
10225 16425
6592 7716
155 4118
10898 18146
4312 14944
17785 18332
4443 9820
5308 8635
4948 5081
6722 16746
16991 18234
17331 18033
1851 11205
8335 18300
...

output:

0 1 1 1 0 0 1 1 0 1 0 1 0 0 1 1 1 1 1 0 1 1 1 0 1 1 1 0 0 1 1 1 1 0 0 0 1 0 0 1 0 1 1 1 0 1 0 0 1 1 0 1 0 0 0 0 0 0 1 0 1 0 1 1 1 0 1 1 0 1 0 1 1 1 1 1 1 1 0 1 0 0 1 0 0 0 0 1 0 1 0 0 1 1 1 1 0 0 0 1 1 0 0 1 0 0 0 1 0 1 0 0 1 0 0 1 1 1 1 0 1 1 0 0 1 1 1 1 1 1 1 1 0 1 0 0 1 1 1 0 0 1 0 1 0 0 0 0 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 7215

result:

ok Number of moves = 7215

Test #71:

score: 71
Accepted
time: 2ms
memory: 4400kb

input:

2 1 2 12 1
0 1

output:

1 

input:

Interaction has been finished!

output:

Number of moves = 1

result:

ok Number of moves = 1

Test #72:

score: 71
Accepted
time: 12ms
memory: 9352kb

input:

20000 19999 2 12 4845
1892 4845
0 15229
0 4911
4845 14719
0 12636
4845 14065
0 7202
4845 6694
0 19000
0 12941
0 6729
0 13611
0 6142
0 18789
4845 12470
0 12869
2557 4845
0 15622
4845 18923
0 19919
0 12014
0 12800
4845 14953
2941 4845
0 2774
4845 15181
0 5576
4845 15475
4845 14058
0 14949
0 16762
0 34...

output:

0 1 1 0 1 0 1 0 1 1 1 1 1 1 0 1 0 1 0 1 1 1 0 0 1 0 1 0 0 1 1 1 1 1 0 1 0 0 1 1 1 1 0 0 1 0 0 0 0 1 1 1 0 1 0 0 0 0 1 1 1 1 0 1 0 1 1 1 0 1 0 1 1 0 1 0 0 0 1 1 0 0 0 0 0 0 0 1 0 1 0 1 1 1 1 1 0 1 1 0 0 1 0 0 0 0 1 1 1 0 1 1 1 0 0 0 0 0 1 1 1 1 1 0 0 1 1 1 0 1 0 0 1 1 0 1 0 0 0 1 1 0 1 0 0 1 0 1 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 1

result:

ok Number of moves = 1

Test #73:

score: 71
Accepted
time: 34ms
memory: 10364kb

input:

19998 19997 2 12 16973
14197 17750
3073 6510
1402 13540
3701 5002
684 11958
10455 13427
5612 13347
72 10267
273 18867
7150 18555
7003 18008
6011 17963
2581 5345
2858 12960
6416 12165
7965 18130
11946 15586
2939 7986
7217 7314
6071 7540
521 9036
10674 18946
3241 12525
8406 13951
6342 14027
7775 16085...

output:

1 0 0 0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 1 1 0 1 1 0 0 0 1 1 0 0 0 0 0 1 0 0 1 0 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 1 1 0 1 0 0 1 1 1 0 0 0 1 1 0 1 0 1 1 1 1 0 0 0 1 1 0 1 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1 0 0 1 0 1 0 0 1 0 1 1 1 0 0 1 1 1 1 1 0 1 1 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 1 0 1 1 1 0 1 0 1 1 0 1 0 1 1 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 19997

result:

ok Number of moves = 19997

Test #74:

score: 71
Accepted
time: 28ms
memory: 10616kb

input:

19998 19997 2 12 5250
14197 17750
3073 6510
1402 13540
3701 5002
684 11958
10455 13427
5612 13347
72 10267
273 18867
7150 18555
7003 18008
6011 17963
2581 5345
2858 12960
6416 12165
7965 18130
11946 15586
2939 7986
7217 7314
6071 7540
521 9036
10674 18946
3241 12525
8406 13951
6342 14027
7775 16085
...

output:

1 0 0 0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 1 1 0 1 1 0 0 0 1 1 0 0 0 0 0 1 0 0 1 0 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 1 1 0 1 0 0 1 1 1 0 0 0 1 1 0 1 0 1 1 1 1 0 0 0 1 1 0 1 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1 0 0 1 0 1 0 0 1 0 1 1 1 0 0 1 1 1 1 1 0 1 1 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 1 0 1 1 1 0 1 0 1 1 0 1 0 1 1 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 19996

result:

ok Number of moves = 19996

Test #75:

score: 71
Accepted
time: 14ms
memory: 9464kb

input:

19998 19997 2 12 15051
14197 17750
3073 6510
1402 13540
3701 5002
684 11958
10455 13427
5612 13347
72 10267
273 18867
7150 18555
7003 18008
6011 17963
2581 5345
2858 12960
6416 12165
7965 18130
11946 15586
2939 7986
7217 7314
6071 7540
521 9036
10674 18946
3241 12525
8406 13951
6342 14027
7775 16085...

output:

1 0 0 0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 1 1 0 1 1 0 0 0 1 1 0 0 0 0 0 1 0 0 1 0 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 1 1 0 1 0 0 1 1 1 0 0 0 1 1 0 1 0 1 1 1 1 0 0 0 1 1 0 1 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1 0 0 1 0 1 0 0 1 0 1 1 1 0 0 1 1 1 1 1 0 1 1 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 1 0 1 1 1 0 1 0 1 1 0 1 0 1 1 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 995

result:

ok Number of moves = 995

Test #76:

score: 71
Accepted
time: 22ms
memory: 9568kb

input:

19998 19997 2 12 1715
14197 17750
3073 6510
1402 13540
3701 5002
684 11958
10455 13427
5612 13347
72 10267
273 18867
7150 18555
7003 18008
6011 17963
2581 5345
2858 12960
6416 12165
7965 18130
11946 15586
2939 7986
7217 7314
6071 7540
521 9036
10674 18946
3241 12525
8406 13951
6342 14027
7775 16085
...

output:

1 0 0 0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 1 1 0 1 1 0 0 0 1 1 0 0 0 0 0 1 0 0 1 0 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 1 1 0 1 0 0 1 1 1 0 0 0 1 1 0 1 0 1 1 1 1 0 0 0 1 1 0 1 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1 0 0 1 0 1 0 0 1 0 1 1 1 0 0 1 1 1 1 1 0 1 1 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 1 0 1 1 1 0 1 0 1 1 0 1 0 1 1 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 992

result:

ok Number of moves = 992

Test #77:

score: 71
Accepted
time: 32ms
memory: 10352kb

input:

19999 19998 2 12 14007
2069 17293
4223 14499
5499 12930
733 13722
1147 11927
9316 18982
14127 17126
7888 11291
726 4951
9228 16257
11129 12122
1520 4885
5069 13838
14520 19322
8210 16551
3635 19676
58 14670
8803 12335
7883 17831
12807 19884
5750 10918
4035 5469
6214 10364
17016 17777
8390 17803
1159...

output:

1 0 1 1 0 1 1 0 0 1 1 0 1 1 0 0 1 1 1 0 1 0 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 0 0 1 1 0 0 0 0 1 0 0 1 1 1 0 0 1 0 0 1 0 0 1 0 1 1 0 1 1 1 1 0 0 0 1 1 0 1 1 0 0 0 1 0 0 1 1 0 1 0 1 1 0 1 1 1 1 0 1 0 0 1 0 0 1 0 0 1 0 1 0 0 0 0 1 1 0 1 1 1 1 1 0 0 1 1 1 0 1 1 0 1 1 0 1 1 1 1 0 1 0 0 1 0 1 0 1 1 0 1 1 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 19998

result:

ok Number of moves = 19998

Test #78:

score: 71
Accepted
time: 20ms
memory: 10488kb

input:

19999 19998 2 12 18647
2069 17293
4223 14499
5499 12930
733 13722
1147 11927
9316 18982
14127 17126
7888 11291
726 4951
9228 16257
11129 12122
1520 4885
5069 13838
14520 19322
8210 16551
3635 19676
58 14670
8803 12335
7883 17831
12807 19884
5750 10918
4035 5469
6214 10364
17016 17777
8390 17803
1159...

output:

1 0 1 1 0 1 1 0 0 1 1 0 1 1 0 0 1 1 1 0 1 0 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 0 0 1 1 0 0 0 0 1 0 0 1 1 1 0 0 1 0 0 1 0 0 1 0 1 1 0 1 1 1 1 0 0 0 1 1 0 1 1 0 0 0 1 0 0 1 1 0 1 0 1 1 0 1 1 1 1 0 1 0 0 1 0 0 1 0 0 1 0 1 0 0 0 0 1 1 0 1 1 1 1 1 0 0 1 1 1 0 1 1 0 1 1 0 1 1 1 1 0 1 0 0 1 0 1 0 1 1 0 1 1 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 19997

result:

ok Number of moves = 19997

Test #79:

score: 71
Accepted
time: 34ms
memory: 10260kb

input:

20000 19999 2 12 9497
16842 18164
4162 9984
9427 13651
12103 14508
6990 11259
9537 15153
898 11581
4900 14283
10570 11431
2069 3126
1641 13967
6979 9254
12886 19555
7482 15506
13471 19419
10915 13477
3943 5575
8347 14484
7950 14809
17270 18337
15578 19244
4066 19201
844 19882
7635 19076
10905 14604
...

output:

1 1 0 0 0 1 1 0 1 0 1 0 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 0 1 0 0 0 1 1 0 0 0 1 0 1 0 0 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 0 1 1 1 1 0 0 0 1 1 0 1 1 0 1 1 0 1 1 1 0 0 0 0 1 1 0 0 0 1 1 0 1 0 1 1 1 1 1 1 1 0 1 0 0 0 1 1 1 0 0 1 0 1 0 1 1 0 0 0 0 1 0 1 1 1 0 1 1 1 0 0 1 0 0 0 0 0 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 19999

result:

ok Number of moves = 19999

Test #80:

score: 71
Accepted
time: 26ms
memory: 10344kb

input:

20000 19999 2 12 891
16842 18164
4162 9984
9427 13651
12103 14508
6990 11259
9537 15153
898 11581
4900 14283
10570 11431
2069 3126
1641 13967
6979 9254
12886 19555
7482 15506
13471 19419
10915 13477
3943 5575
8347 14484
7950 14809
17270 18337
15578 19244
4066 19201
844 19882
7635 19076
10905 14604
4...

output:

1 1 0 0 0 1 1 0 1 0 1 0 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 0 1 0 0 0 1 1 0 0 0 1 0 1 0 0 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 0 1 1 1 1 0 0 0 1 1 0 1 1 0 1 1 0 1 1 1 0 0 0 0 1 1 0 0 0 1 1 0 1 0 1 1 1 1 1 1 1 0 1 0 0 0 1 1 1 0 0 1 0 1 0 1 1 0 0 0 0 1 0 1 1 1 0 1 1 1 0 0 1 0 0 0 0 0 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 20000

result:

ok Number of moves = 20000

Test #81:

score: 71
Accepted
time: 32ms
memory: 10352kb

input:

20000 19999 2 12 13050
16842 18164
4162 9984
9427 13651
12103 14508
6990 11259
9537 15153
898 11581
4900 14283
10570 11431
2069 3126
1641 13967
6979 9254
12886 19555
7482 15506
13471 19419
10915 13477
3943 5575
8347 14484
7950 14809
17270 18337
15578 19244
4066 19201
844 19882
7635 19076
10905 14604...

output:

1 1 0 0 0 1 1 0 1 0 1 0 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 0 1 0 0 0 1 1 0 0 0 1 0 1 0 0 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 0 1 1 1 1 0 0 0 1 1 0 1 1 0 1 1 0 1 1 1 0 0 0 0 1 1 0 0 0 1 1 0 1 0 1 1 1 1 1 1 1 0 1 0 0 0 1 1 1 0 0 1 0 1 0 1 1 0 0 0 0 1 0 1 1 1 0 1 1 1 0 0 1 0 0 0 0 0 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 20001

result:

ok Number of moves = 20001

Test #82:

score: 71
Accepted
time: 24ms
memory: 10524kb

input:

20000 19999 2 12 12964
16842 18164
4162 9984
9427 13651
12103 14508
6990 11259
9537 15153
898 11581
4900 14283
10570 11431
2069 3126
1641 13967
6979 9254
12886 19555
7482 15506
13471 19419
10915 13477
3943 5575
8347 14484
7950 14809
17270 18337
15578 19244
4066 19201
844 19882
7635 19076
10905 14604...

output:

1 1 0 0 0 1 1 0 1 0 1 0 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 0 1 0 0 0 1 1 0 0 0 1 0 1 0 0 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 0 1 1 1 1 0 0 0 1 1 0 1 1 0 1 1 0 1 1 1 0 0 0 0 1 1 0 0 0 1 1 0 1 0 1 1 1 1 1 1 1 0 1 0 0 0 1 1 1 0 0 1 0 1 0 1 1 0 0 0 0 1 0 1 1 1 0 1 1 1 0 0 1 0 0 0 0 0 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 19996

result:

ok Number of moves = 19996

Test #83:

score: 71
Accepted
time: 24ms
memory: 10472kb

input:

20000 19999 2 12 17890
16842 18164
4162 9984
9427 13651
12103 14508
6990 11259
9537 15153
898 11581
4900 14283
10570 11431
2069 3126
1641 13967
6979 9254
12886 19555
7482 15506
13471 19419
10915 13477
3943 5575
8347 14484
7950 14809
17270 18337
15578 19244
4066 19201
844 19882
7635 19076
10905 14604...

output:

1 1 0 0 0 1 1 0 1 0 1 0 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 0 1 0 0 0 1 1 0 0 0 1 0 1 0 0 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 0 1 1 1 1 0 0 0 1 1 0 1 1 0 1 1 0 1 1 1 0 0 0 0 1 1 0 0 0 1 1 0 1 0 1 1 1 1 1 1 1 0 1 0 0 0 1 1 1 0 0 1 0 1 0 1 1 0 0 0 0 1 0 1 1 1 0 1 1 1 0 0 1 0 0 0 0 0 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 19999

result:

ok Number of moves = 19999

Test #84:

score: 71
Accepted
time: 24ms
memory: 10580kb

input:

20000 19999 2 12 15032
16842 18164
4162 9984
9427 13651
12103 14508
6990 11259
9537 15153
898 11581
4900 14283
10570 11431
2069 3126
1641 13967
6979 9254
12886 19555
7482 15506
13471 19419
10915 13477
3943 5575
8347 14484
7950 14809
17270 18337
15578 19244
4066 19201
844 19882
7635 19076
10905 14604...

output:

1 1 0 0 0 1 1 0 1 0 1 0 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 0 1 0 0 0 1 1 0 0 0 1 0 1 0 0 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 0 1 1 1 1 0 0 0 1 1 0 1 1 0 1 1 0 1 1 1 0 0 0 0 1 1 0 0 0 1 1 0 1 0 1 1 1 1 1 1 1 0 1 0 0 0 1 1 1 0 0 1 0 1 0 1 1 0 0 0 0 1 0 1 1 1 0 1 1 1 0 0 1 0 0 0 0 0 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 19994

result:

ok Number of moves = 19994

Test #85:

score: 71
Accepted
time: 22ms
memory: 10164kb

input:

20000 19999 2 12 10598
16842 18164
4162 9984
9427 13651
12103 14508
6990 11259
9537 15153
898 11581
4900 14283
10570 11431
2069 3126
1641 13967
6979 9254
12886 19555
7482 15506
13471 19419
10915 13477
3943 5575
8347 14484
7950 14809
17270 18337
15578 19244
4066 19201
844 19882
7635 19076
10905 14604...

output:

1 1 0 0 0 1 1 0 1 0 1 0 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 0 1 0 0 0 1 1 0 0 0 1 0 1 0 0 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 0 1 1 1 1 0 0 0 1 1 0 1 1 0 1 1 0 1 1 1 0 0 0 0 1 1 0 0 0 1 1 0 1 0 1 1 1 1 1 1 1 0 1 0 0 0 1 1 1 0 0 1 0 1 0 1 1 0 0 0 0 1 0 1 1 1 0 1 1 1 0 0 1 0 0 0 0 0 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 13341

result:

ok Number of moves = 13341

Test #86:

score: 71
Accepted
time: 16ms
memory: 10208kb

input:

20000 19999 2 12 5786
16842 18164
4162 9984
9427 13651
12103 14508
6990 11259
9537 15153
898 11581
4900 14283
10570 11431
2069 3126
1641 13967
6979 9254
12886 19555
7482 15506
13471 19419
10915 13477
3943 5575
8347 14484
7950 14809
17270 18337
15578 19244
4066 19201
844 19882
7635 19076
10905 14604
...

output:

1 1 0 0 0 1 1 0 1 0 1 0 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 0 1 0 0 0 1 1 0 0 0 1 0 1 0 0 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 0 1 1 1 1 0 0 0 1 1 0 1 1 0 1 1 0 1 1 1 0 0 0 0 1 1 0 0 0 1 1 0 1 0 1 1 1 1 1 1 1 0 1 0 0 0 1 1 1 0 0 1 0 1 0 1 1 0 0 0 0 1 0 1 1 1 0 1 1 1 0 0 1 0 0 0 0 0 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 13336

result:

ok Number of moves = 13336

Test #87:

score: 71
Accepted
time: 14ms
memory: 9992kb

input:

20000 19999 2 12 9366
16842 18164
4162 9984
9427 13651
12103 14508
6990 11259
9537 15153
898 11581
4900 14283
10570 11431
2069 3126
1641 13967
6979 9254
12886 19555
7482 15506
13471 19419
10915 13477
3943 5575
8347 14484
7950 14809
17270 18337
15578 19244
4066 19201
844 19882
7635 19076
10905 14604
...

output:

1 1 0 0 0 1 1 0 1 0 1 0 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 0 1 0 0 0 1 1 0 0 0 1 0 1 0 0 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 0 1 1 1 1 0 0 0 1 1 0 1 1 0 1 1 0 1 1 1 0 0 0 0 1 1 0 0 0 1 1 0 1 0 1 1 1 1 1 1 1 0 1 0 0 0 1 1 1 0 0 1 0 1 0 1 1 0 0 0 0 1 0 1 1 1 0 1 1 1 0 0 1 0 0 0 0 0 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 13339

result:

ok Number of moves = 13339

Test #88:

score: 71
Accepted
time: 22ms
memory: 10076kb

input:

20000 19999 2 12 11526
16842 18164
4162 9984
9427 13651
12103 14508
6990 11259
9537 15153
898 11581
4900 14283
10570 11431
2069 3126
1641 13967
6979 9254
12886 19555
7482 15506
13471 19419
10915 13477
3943 5575
8347 14484
7950 14809
17270 18337
15578 19244
4066 19201
844 19882
7635 19076
10905 14604...

output:

1 1 0 0 0 1 1 0 1 0 1 0 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 0 1 0 0 0 1 1 0 0 0 1 0 1 0 0 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 0 1 1 1 1 0 0 0 1 1 0 1 1 0 1 1 0 1 1 1 0 0 0 0 1 1 0 0 0 1 1 0 1 0 1 1 1 1 1 1 1 0 1 0 0 0 1 1 1 0 0 1 0 1 0 1 1 0 0 0 0 1 0 1 1 1 0 1 1 1 0 0 1 0 0 0 0 0 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 13334

result:

ok Number of moves = 13334

Test #89:

score: 71
Accepted
time: 22ms
memory: 9996kb

input:

20000 19999 2 12 10123
16842 18164
4162 9984
9427 13651
12103 14508
6990 11259
9537 15153
898 11581
4900 14283
10570 11431
2069 3126
1641 13967
6979 9254
12886 19555
7482 15506
13471 19419
10915 13477
3943 5575
8347 14484
7950 14809
17270 18337
15578 19244
4066 19201
844 19882
7635 19076
10905 14604...

output:

1 1 0 0 0 1 1 0 1 0 1 0 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 0 1 0 0 0 1 1 0 0 0 1 0 1 0 0 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 0 1 1 1 1 0 0 0 1 1 0 1 1 0 1 1 0 1 1 1 0 0 0 0 1 1 0 0 0 1 1 0 1 0 1 1 1 1 1 1 1 0 1 0 0 0 1 1 1 0 0 1 0 1 0 1 1 0 0 0 0 1 0 1 1 1 0 1 1 1 0 0 1 0 0 0 0 0 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 13337

result:

ok Number of moves = 13337

Test #90:

score: 71
Accepted
time: 30ms
memory: 9988kb

input:

20000 19999 2 12 15682
16842 18164
4162 9984
9427 13651
12103 14508
6990 11259
9537 15153
898 11581
4900 14283
10570 11431
2069 3126
1641 13967
6979 9254
12886 19555
7482 15506
13471 19419
10915 13477
3943 5575
8347 14484
7950 14809
17270 18337
15578 19244
4066 19201
844 19882
7635 19076
10905 14604...

output:

1 1 0 0 0 1 1 0 1 0 1 0 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 0 1 0 0 0 1 1 0 0 0 1 0 1 0 0 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 0 1 1 1 1 0 0 0 1 1 0 1 1 0 1 1 0 1 1 1 0 0 0 0 1 1 0 0 0 1 1 0 1 0 1 1 1 1 1 1 1 0 1 0 0 0 1 1 1 0 0 1 0 1 0 1 1 0 0 0 0 1 0 1 1 1 0 1 1 1 0 0 1 0 0 0 0 0 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 13338

result:

ok Number of moves = 13338

Test #91:

score: 71
Accepted
time: 20ms
memory: 9412kb

input:

19998 19997 2 12 4001
4313 14791
4055 12040
4328 11750
1380 7942
3222 9865
8946 15131
4112 6709
7626 18770
2556 12998
14410 15748
7918 15592
2459 18480
7906 14120
715 12645
814 19728
2064 13904
9520 17686
2105 17720
4944 8333
1360 3702
2541 2548
1284 12432
556 18568
12117 14712
6153 9790
9240 9955
3...

output:

0 1 1 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 1 0 1 1 0 1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 0 0 1 0 1 0 1 1 1 0 1 0 1 0 1 1 1 0 1 1 0 1 1 0 1 0 1 0 0 0 1 1 0 1 1 0 0 0 0 1 0 0 0 1 1 0 1 1 0 0 1 1 1 1 0 0 1 0 1 0 0 1 1 1 1 0 1 1 0 1 0 0 1 1 0 1 1 0 0 0 0 1 1 1 1 0 1 1 0 1 1 0 1 0 0 1 1 1 0 1 1 1 1 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 101

result:

ok Number of moves = 101

Test #92:

score: 71
Accepted
time: 20ms
memory: 9368kb

input:

19998 19997 2 12 10860
4313 14791
4055 12040
4328 11750
1380 7942
3222 9865
8946 15131
4112 6709
7626 18770
2556 12998
14410 15748
7918 15592
2459 18480
7906 14120
715 12645
814 19728
2064 13904
9520 17686
2105 17720
4944 8333
1360 3702
2541 2548
1284 12432
556 18568
12117 14712
6153 9790
9240 9955
...

output:

0 1 1 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 1 0 1 1 0 1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 0 0 1 0 1 0 1 1 1 0 1 0 1 0 1 1 1 0 1 1 0 1 1 0 1 0 1 0 0 0 1 1 0 1 1 0 0 0 0 1 0 0 0 1 1 0 1 1 0 0 1 1 1 1 0 0 1 0 1 0 0 1 1 1 1 0 1 1 0 1 0 0 1 1 0 1 1 0 0 0 0 1 1 1 1 0 1 1 0 1 1 0 1 0 0 1 1 1 0 1 1 1 1 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 106

result:

ok Number of moves = 106

Test #93:

score: 71
Accepted
time: 0ms
memory: 9552kb

input:

19998 19997 2 12 5866
1832 7520
3577 16584
2089 9485
1646 5768
1563 12709
14098 15299
14790 16552
17845 19490
14644 16395
10235 13873
1298 8475
8582 18624
40 9866
5315 10698
5375 8579
16105 16261
1173 7442
17464 19269
9211 11696
2295 5980
2046 19112
846 5305
12951 16803
5774 6766
9408 12092
3287 871...

output:

1 1 1 1 1 1 1 0 0 0 1 0 1 0 1 1 0 0 0 0 1 0 1 1 0 0 0 0 0 1 0 0 1 1 0 0 1 1 0 1 1 0 1 1 1 1 1 0 0 1 1 0 0 1 1 1 0 0 0 1 0 1 0 1 1 1 0 1 1 0 0 0 0 0 1 1 0 1 1 1 1 0 1 1 1 0 1 1 0 0 1 1 0 0 0 1 1 1 0 1 1 0 0 1 1 0 1 0 0 0 0 0 0 1 0 1 1 0 1 1 0 0 1 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 1 1 1 0 0 1 0 1 0 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 2087

result:

ok Number of moves = 2087

Test #94:

score: 71
Accepted
time: 22ms
memory: 9472kb

input:

19998 19997 2 12 19026
1832 7520
3577 16584
2089 9485
1646 5768
1563 12709
14098 15299
14790 16552
17845 19490
14644 16395
10235 13873
1298 8475
8582 18624
40 9866
5315 10698
5375 8579
16105 16261
1173 7442
17464 19269
9211 11696
2295 5980
2046 19112
846 5305
12951 16803
5774 6766
9408 12092
3287 87...

output:

1 1 1 1 1 1 1 0 0 0 1 0 1 0 1 1 0 0 0 0 1 0 1 1 0 0 0 0 0 1 0 0 1 1 0 0 1 1 0 1 1 0 1 1 1 1 1 0 0 1 1 0 0 1 1 1 0 0 0 1 0 1 0 1 1 1 0 1 1 0 0 0 0 0 1 1 0 1 1 1 1 0 1 1 1 0 1 1 0 0 1 1 0 0 0 1 1 1 0 1 1 0 0 1 1 0 1 0 0 0 0 0 0 1 0 1 1 0 1 1 0 0 1 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 1 1 1 0 0 1 0 1 0 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 2090

result:

ok Number of moves = 2090

Test #95:

score: 71
Accepted
time: 20ms
memory: 9748kb

input:

19998 19997 2 12 1391
15653 18311
1245 9582
18673 19521
3039 13643
2414 8759
6166 11313
4050 8607
7884 10083
3854 14102
9704 15448
12981 19576
3307 10465
5867 18490
9419 15429
8972 14448
7328 12764
1594 8948
2207 11620
7089 16713
846 8219
271 6896
278 18092
5773 9584
4996 14005
3422 16175
18304 1976...

output:

1 1 1 1 1 1 1 1 0 0 0 1 1 0 1 0 1 0 0 0 0 0 0 1 0 1 1 0 0 1 0 0 0 0 1 1 1 1 1 0 1 0 0 0 1 1 1 1 1 0 0 1 0 0 1 0 0 1 1 1 0 1 0 1 0 1 1 0 1 1 0 1 1 1 0 0 0 0 0 1 1 0 0 0 0 1 1 1 0 1 0 1 1 0 1 1 1 1 1 1 1 0 1 1 0 1 0 0 1 1 0 0 0 0 0 1 1 0 1 1 0 1 1 0 0 0 0 0 1 1 1 1 1 0 0 1 1 0 0 1 1 0 1 1 1 1 1 1 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 10011

result:

ok Number of moves = 10011

Test #96:

score: 71
Accepted
time: 12ms
memory: 9744kb

input:

19998 19997 2 12 8492
15653 18311
1245 9582
18673 19521
3039 13643
2414 8759
6166 11313
4050 8607
7884 10083
3854 14102
9704 15448
12981 19576
3307 10465
5867 18490
9419 15429
8972 14448
7328 12764
1594 8948
2207 11620
7089 16713
846 8219
271 6896
278 18092
5773 9584
4996 14005
3422 16175
18304 1976...

output:

1 1 1 1 1 1 1 1 0 0 0 1 1 0 1 0 1 0 0 0 0 0 0 1 0 1 1 0 0 1 0 0 0 0 1 1 1 1 1 0 1 0 0 0 1 1 1 1 1 0 0 1 0 0 1 0 0 1 1 1 0 1 0 1 0 1 1 0 1 1 0 1 1 1 0 0 0 0 0 1 1 0 0 0 0 1 1 1 0 1 0 1 1 0 1 1 1 1 1 1 1 0 1 1 0 1 0 0 1 1 0 0 0 0 0 1 1 0 1 1 0 1 1 0 0 0 0 0 1 1 1 1 1 0 0 1 1 0 0 1 1 0 1 1 1 1 1 1 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 10006

result:

ok Number of moves = 10006

Test #97:

score: 71
Accepted
time: 26ms
memory: 9748kb

input:

19998 19997 2 12 7855
7603 10363
2984 12139
13483 15962
2672 7800
5461 10772
8002 17109
549 19436
2432 17220
3450 3938
12446 15037
567 12282
3585 4881
17699 19008
173 9477
4759 9931
1830 14017
4559 16867
1186 9643
15649 18288
3433 7819
14618 14999
6772 8087
8 19736
19 16302
11549 13203
49 3118
4726 ...

output:

1 1 1 1 1 1 1 0 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 0 0 0 0 1 1 0 1 1 0 1 0 0 1 0 0 1 1 0 1 0 1 1 1 0 1 0 1 1 1 1 0 1 0 0 1 1 1 1 1 0 0 1 0 0 1 1 0 1 0 1 0 0 1 1 1 0 1 1 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 1 1 0 1 1 1 0 0 0 1 0 1 0 0 0 1 0 0 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 1 1 0 0 1 0 0 0 0 1 0 0 1 0 0 1 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 10246

result:

ok Number of moves = 10246

Test #98:

score: 71
Accepted
time: 26ms
memory: 9728kb

input:

19998 19997 2 12 6875
7603 10363
2984 12139
13483 15962
2672 7800
5461 10772
8002 17109
549 19436
2432 17220
3450 3938
12446 15037
567 12282
3585 4881
17699 19008
173 9477
4759 9931
1830 14017
4559 16867
1186 9643
15649 18288
3433 7819
14618 14999
6772 8087
8 19736
19 16302
11549 13203
49 3118
4726 ...

output:

1 1 1 1 1 1 1 0 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 0 0 0 0 1 1 0 1 1 0 1 0 0 1 0 0 1 1 0 1 0 1 1 1 0 1 0 1 1 1 1 0 1 0 0 1 1 1 1 1 0 0 1 0 0 1 1 0 1 0 1 0 0 1 1 1 0 1 1 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 1 1 0 1 1 1 0 0 0 1 0 1 0 0 0 1 0 0 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 1 1 0 0 1 0 0 0 0 1 0 0 1 0 0 1 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 10249

result:

ok Number of moves = 10249

Test #99:

score: 71
Accepted
time: 14ms
memory: 9412kb

input:

20000 19999 2 12 3730
11156 12943
5809 10107
625 15667
6792 11879
1131 15235
6239 11535
10385 15506
6889 19086
11053 13664
5695 14839
4478 10628
17 4162
8930 13215
4736 19290
2990 17372
1614 17354
290 1907
15792 18547
4162 12253
9199 11467
5227 10029
15928 19033
10938 17154
114 2459
3632 11493
183 1...

output:

1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 0 1 0 0 1 1 0 0 1 0 1 0 0 0 1 1 1 0 1 0 0 1 0 1 1 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 0 1 0 1 1 0 0 1 0 0 0 1 0 1 1 1 0 0 0 0 1 1 1 1 1 0 1 0 0 1 1 1 0 0 1 0 0 1 0 0 1 1 0 0 1 1 1 1 0 0 1 1 1 0 1 0 1 0 1 0 0 1 1 0 1 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 1 1 1 0 0 0 1 0 1 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 22

result:

ok Number of moves = 22

Test #100:

score: 71
Accepted
time: 20ms
memory: 9304kb

input:

20000 19999 2 12 1408
11156 12943
5809 10107
625 15667
6792 11879
1131 15235
6239 11535
10385 15506
6889 19086
11053 13664
5695 14839
4478 10628
17 4162
8930 13215
4736 19290
2990 17372
1614 17354
290 1907
15792 18547
4162 12253
9199 11467
5227 10029
15928 19033
10938 17154
114 2459
3632 11493
183 1...

output:

1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 0 1 0 0 1 1 0 0 1 0 1 0 0 0 1 1 1 0 1 0 0 1 0 1 1 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 0 1 0 1 1 0 0 1 0 0 0 1 0 1 1 1 0 0 0 0 1 1 1 1 1 0 1 0 0 1 1 1 0 0 1 0 0 1 0 0 1 1 0 0 1 1 1 1 0 0 1 1 1 0 1 0 1 0 1 0 0 1 1 0 1 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 1 1 1 0 0 0 1 0 1 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 19

result:

ok Number of moves = 19

Test #101:

score: 71
Accepted
time: 22ms
memory: 9536kb

input:

20000 19999 2 12 6228
3876 13713
8571 16774
1755 12898
3401 12562
105 5052
3648 19337
6277 8835
15775 17521
6439 10958
8564 17718
11441 17919
7836 10619
14500 19388
8348 15415
1702 9001
10117 14541
5497 17436
5735 11011
17160 18498
508 9666
10525 19720
5662 19915
1064 3012
6053 7840
5239 5863
4907 7...

output:

1 1 1 0 0 0 1 1 1 0 1 1 1 1 1 0 0 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 0 0 0 0 1 1 0 1 1 1 1 0 1 1 1 1 1 0 1 0 0 1 0 0 1 1 1 1 1 0 1 1 0 1 1 0 1 0 0 1 1 1 0 0 0 0 1 1 0 0 1 0 0 0 0 1 0 1 1 1 1 1 1 1 0 1 0 0 1 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 0 1 1 1 1 1 1 0 0 1 1 1 0 0 0 1 0 0 0 0 1 0 1 0 0 0 0 0 1 1 1 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 2132

result:

ok Number of moves = 2132

Test #102:

score: 71
Accepted
time: 22ms
memory: 9524kb

input:

20000 19999 2 12 8926
3876 13713
8571 16774
1755 12898
3401 12562
105 5052
3648 19337
6277 8835
15775 17521
6439 10958
8564 17718
11441 17919
7836 10619
14500 19388
8348 15415
1702 9001
10117 14541
5497 17436
5735 11011
17160 18498
508 9666
10525 19720
5662 19915
1064 3012
6053 7840
5239 5863
4907 7...

output:

1 1 1 0 0 0 1 1 1 0 1 1 1 1 1 0 0 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 0 0 0 0 1 1 0 1 1 1 1 0 1 1 1 1 1 0 1 0 0 1 0 0 1 1 1 1 1 0 1 1 0 1 1 0 1 0 0 1 1 1 0 0 0 0 1 1 0 0 1 0 0 0 0 1 0 1 1 1 1 1 1 1 0 1 0 0 1 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 0 1 1 1 1 1 1 0 0 1 1 1 0 0 0 1 0 0 0 0 1 0 1 0 0 0 0 0 1 1 1 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 2431

result:

ok Number of moves = 2431

Test #103:

score: 71
Accepted
time: 16ms
memory: 9804kb

input:

20000 19999 2 12 15519
4731 16017
7233 18446
1112 15082
1745 10708
852 16333
2202 14040
8761 9780
3400 3755
5338 19258
6946 11132
588 10414
2779 5749
1694 5079
18451 19296
7013 14822
10379 14204
10402 15002
9077 14586
12095 15831
2472 10293
5357 13082
2801 14461
9671 17393
6347 14388
4995 17173
1104...

output:

1 0 1 0 1 0 1 1 1 1 0 1 0 1 0 0 1 1 1 1 0 1 0 1 0 1 1 0 0 1 0 1 1 0 1 0 1 0 0 1 1 0 0 1 1 1 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 1 1 1 1 1 0 1 0 1 0 1 0 1 1 0 0 1 1 1 0 0 0 1 1 0 1 1 1 0 1 0 1 0 0 0 1 1 1 0 0 0 1 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 1 0 1 1 1 0 1 1 1 1 0 0 0 1 1 1 1 0 0 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 9004

result:

ok Number of moves = 9004

Test #104:

score: 71
Accepted
time: 26ms
memory: 9936kb

input:

20000 19999 2 12 5276
4731 16017
7233 18446
1112 15082
1745 10708
852 16333
2202 14040
8761 9780
3400 3755
5338 19258
6946 11132
588 10414
2779 5749
1694 5079
18451 19296
7013 14822
10379 14204
10402 15002
9077 14586
12095 15831
2472 10293
5357 13082
2801 14461
9671 17393
6347 14388
4995 17173
11049...

output:

1 0 1 0 1 0 1 1 1 1 0 1 0 1 0 0 1 1 1 1 0 1 0 1 0 1 1 0 0 1 0 1 1 0 1 0 1 0 0 1 1 0 0 1 1 1 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 1 1 1 1 1 0 1 0 1 0 1 0 1 1 0 0 1 1 1 0 0 0 1 1 0 1 1 1 0 1 0 1 0 0 0 1 1 1 0 0 0 1 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 1 0 1 1 1 0 1 1 1 1 0 0 0 1 1 1 1 0 0 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 9001

result:

ok Number of moves = 9001

Test #105:

score: 71
Accepted
time: 20ms
memory: 9788kb

input:

20000 19999 2 12 18314
4731 16017
7233 18446
1112 15082
1745 10708
852 16333
2202 14040
8761 9780
3400 3755
5338 19258
6946 11132
588 10414
2779 5749
1694 5079
18451 19296
7013 14822
10379 14204
10402 15002
9077 14586
12095 15831
2472 10293
5357 13082
2801 14461
9671 17393
6347 14388
4995 17173
1104...

output:

1 0 1 0 1 0 1 1 1 1 0 1 0 1 0 0 1 1 1 1 0 1 0 1 0 1 1 0 0 1 0 1 1 0 1 0 1 0 0 1 1 0 0 1 1 1 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 1 1 1 1 1 0 1 0 1 0 1 0 1 1 0 0 1 1 1 0 0 0 1 1 0 1 1 1 0 1 0 1 0 0 0 1 1 1 0 0 0 1 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 1 0 1 1 1 0 1 1 1 1 0 0 0 1 1 1 1 0 0 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 9006

result:

ok Number of moves = 9006

Test #106:

score: 71
Accepted
time: 12ms
memory: 9832kb

input:

20000 19999 2 12 15956
4731 16017
7233 18446
1112 15082
1745 10708
852 16333
2202 14040
8761 9780
3400 3755
5338 19258
6946 11132
588 10414
2779 5749
1694 5079
18451 19296
7013 14822
10379 14204
10402 15002
9077 14586
12095 15831
2472 10293
5357 13082
2801 14461
9671 17393
6347 14388
4995 17173
1104...

output:

1 0 1 0 1 0 1 1 1 1 0 1 0 1 0 0 1 1 1 1 0 1 0 1 0 1 1 0 0 1 0 1 1 0 1 0 1 0 0 1 1 0 0 1 1 1 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 1 1 1 1 1 0 1 0 1 0 1 0 1 1 0 0 1 1 1 0 0 0 1 1 0 1 1 1 0 1 0 1 0 0 0 1 1 1 0 0 0 1 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 1 0 1 1 1 0 1 1 1 1 0 0 0 1 1 1 1 0 0 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 9003

result:

ok Number of moves = 9003

Test #107:

score: 71
Accepted
time: 6ms
memory: 9744kb

input:

20000 19999 2 12 2508
4731 16017
7233 18446
1112 15082
1745 10708
852 16333
2202 14040
8761 9780
3400 3755
5338 19258
6946 11132
588 10414
2779 5749
1694 5079
18451 19296
7013 14822
10379 14204
10402 15002
9077 14586
12095 15831
2472 10293
5357 13082
2801 14461
9671 17393
6347 14388
4995 17173
11049...

output:

1 0 1 0 1 0 1 1 1 1 0 1 0 1 0 0 1 1 1 1 0 1 0 1 0 1 1 0 0 1 0 1 1 0 1 0 1 0 0 1 1 0 0 1 1 1 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 1 1 1 1 1 0 1 0 1 0 1 0 1 1 0 0 1 1 1 0 0 0 1 1 0 1 1 1 0 1 0 1 0 0 0 1 1 1 0 0 0 1 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 1 0 1 1 1 0 1 1 1 1 0 0 0 1 1 1 1 0 0 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 9008

result:

ok Number of moves = 9008

Test #108:

score: 71
Accepted
time: 26ms
memory: 9728kb

input:

20000 19999 2 12 5294
4731 16017
7233 18446
1112 15082
1745 10708
852 16333
2202 14040
8761 9780
3400 3755
5338 19258
6946 11132
588 10414
2779 5749
1694 5079
18451 19296
7013 14822
10379 14204
10402 15002
9077 14586
12095 15831
2472 10293
5357 13082
2801 14461
9671 17393
6347 14388
4995 17173
11049...

output:

1 0 1 0 1 0 1 1 1 1 0 1 0 1 0 0 1 1 1 1 0 1 0 1 0 1 1 0 0 1 0 1 1 0 1 0 1 0 0 1 1 0 0 1 1 1 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 1 1 1 1 1 0 1 0 1 0 1 0 1 1 0 0 1 1 1 0 0 0 1 1 0 1 1 1 0 1 0 1 0 0 0 1 1 1 0 0 0 1 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 1 0 1 1 1 0 1 1 1 1 0 0 0 1 1 1 1 0 0 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 9011

result:

ok Number of moves = 9011

Test #109:

score: 71
Accepted
time: 14ms
memory: 10008kb

input:

20000 19999 2 12 9403
11617 19746
10871 14657
712 7580
17475 18019
14092 18245
1222 6046
2349 9905
1525 14936
8409 18786
3372 12648
1070 7494
8134 13297
579 18553
5462 14767
36 12948
12208 19007
7923 14370
8351 15272
5863 19462
783 17384
274 18196
1279 7732
1174 6600
9552 13081
4079 12760
8865 11136...

output:

0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 0 1 0 1 1 0 1 1 1 0 0 0 1 0 0 0 0 1 1 0 0 0 1 1 0 1 1 1 0 1 0 1 1 1 1 1 0 0 0 0 1 0 1 0 1 1 0 1 0 0 0 0 1 1 0 0 1 1 0 1 1 0 1 0 1 1 1 0 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 1 0 0 1 1 1 0 1 1 0 1 1 1 1 0 1 0 0 1 1 1 1 0 1 1 0 1 0 0 1 0 0 0 0 0 1 1 0 0 1 1 0 1 1 1 0 1 1 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 13246

result:

ok Number of moves = 13246

Test #110:

score: 71
Accepted
time: 20ms
memory: 9996kb

input:

20000 19999 2 12 12817
11617 19746
10871 14657
712 7580
17475 18019
14092 18245
1222 6046
2349 9905
1525 14936
8409 18786
3372 12648
1070 7494
8134 13297
579 18553
5462 14767
36 12948
12208 19007
7923 14370
8351 15272
5863 19462
783 17384
274 18196
1279 7732
1174 6600
9552 13081
4079 12760
8865 1113...

output:

0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 0 1 0 1 1 0 1 1 1 0 0 0 1 0 0 0 0 1 1 0 0 0 1 1 0 1 1 1 0 1 0 1 1 1 1 1 0 0 0 0 1 0 1 0 1 1 0 1 0 0 0 0 1 1 0 0 1 1 0 1 1 0 1 0 1 1 1 0 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 1 0 0 1 1 1 0 1 1 0 1 1 1 1 0 1 0 0 1 1 1 1 0 1 1 0 1 0 0 1 0 0 0 0 0 1 1 0 0 1 1 0 1 1 1 0 1 1 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 13249

result:

ok Number of moves = 13249

Test #111:

score: 71
Accepted
time: 22ms
memory: 10200kb

input:

20000 19999 2 12 7689
11617 19746
10871 14657
712 7580
17475 18019
14092 18245
1222 6046
2349 9905
1525 14936
8409 18786
3372 12648
1070 7494
8134 13297
579 18553
5462 14767
36 12948
12208 19007
7923 14370
8351 15272
5863 19462
783 17384
274 18196
1279 7732
1174 6600
9552 13081
4079 12760
8865 11136...

output:

0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 0 1 0 1 1 0 1 1 1 0 0 0 1 0 0 0 0 1 1 0 0 0 1 1 0 1 1 1 0 1 0 1 1 1 1 1 0 0 0 0 1 0 1 0 1 1 0 1 0 0 0 0 1 1 0 0 1 1 0 1 1 0 1 0 1 1 1 0 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 1 0 0 1 1 1 0 1 1 0 1 1 1 1 0 1 0 0 1 1 1 1 0 1 1 0 1 0 0 1 0 0 0 0 0 1 1 0 0 1 1 0 1 1 1 0 1 1 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 13248

result:

ok Number of moves = 13248

Test #112:

score: 71
Accepted
time: 30ms
memory: 10168kb

input:

20000 19999 2 12 8378
11617 19746
10871 14657
712 7580
17475 18019
14092 18245
1222 6046
2349 9905
1525 14936
8409 18786
3372 12648
1070 7494
8134 13297
579 18553
5462 14767
36 12948
12208 19007
7923 14370
8351 15272
5863 19462
783 17384
274 18196
1279 7732
1174 6600
9552 13081
4079 12760
8865 11136...

output:

0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 0 1 0 1 1 0 1 1 1 0 0 0 1 0 0 0 0 1 1 0 0 0 1 1 0 1 1 1 0 1 0 1 1 1 1 1 0 0 0 0 1 0 1 0 1 1 0 1 0 0 0 0 1 1 0 0 1 1 0 1 1 0 1 0 1 1 1 0 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 1 0 0 1 1 1 0 1 1 0 1 1 1 1 0 1 0 0 1 1 1 1 0 1 1 0 1 0 0 1 0 0 0 0 0 1 1 0 0 1 1 0 1 1 1 0 1 1 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 14000

result:

ok Number of moves = 14000

Test #113:

score: 71
Accepted
time: 14ms
memory: 10004kb

input:

20000 19999 2 12 19979
11617 19746
10871 14657
712 7580
17475 18019
14092 18245
1222 6046
2349 9905
1525 14936
8409 18786
3372 12648
1070 7494
8134 13297
579 18553
5462 14767
36 12948
12208 19007
7923 14370
8351 15272
5863 19462
783 17384
274 18196
1279 7732
1174 6600
9552 13081
4079 12760
8865 1113...

output:

0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 0 1 0 1 1 0 1 1 1 0 0 0 1 0 0 0 0 1 1 0 0 0 1 1 0 1 1 1 0 1 0 1 1 1 1 1 0 0 0 0 1 0 1 0 1 1 0 1 0 0 0 0 1 1 0 0 1 1 0 1 1 0 1 0 1 1 1 0 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 1 0 0 1 1 1 0 1 1 0 1 1 1 1 0 1 0 0 1 1 1 1 0 1 1 0 1 0 0 1 0 0 0 0 0 1 1 0 0 1 1 0 1 1 1 0 1 1 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 13997

result:

ok Number of moves = 13997

Test #114:

score: 71
Accepted
time: 28ms
memory: 10288kb

input:

20000 19999 2 12 16832
11617 19746
10871 14657
712 7580
17475 18019
14092 18245
1222 6046
2349 9905
1525 14936
8409 18786
3372 12648
1070 7494
8134 13297
579 18553
5462 14767
36 12948
12208 19007
7923 14370
8351 15272
5863 19462
783 17384
274 18196
1279 7732
1174 6600
9552 13081
4079 12760
8865 1113...

output:

0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 0 1 0 1 1 0 1 1 1 0 0 0 1 0 0 0 0 1 1 0 0 0 1 1 0 1 1 1 0 1 0 1 1 1 1 1 0 0 0 0 1 0 1 0 1 1 0 1 0 0 0 0 1 1 0 0 1 1 0 1 1 0 1 0 1 1 1 0 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 1 0 0 1 1 1 0 1 1 0 1 1 1 1 0 1 0 0 1 1 1 1 0 1 1 0 1 0 0 1 0 0 0 0 0 1 1 0 0 1 1 0 1 1 1 0 1 1 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 14000

result:

ok Number of moves = 14000

Test #115:

score: 71
Accepted
time: 24ms
memory: 9736kb

input:

19999 19998 2 12 5023
3335 11827
14258 18043
2601 8536
5039 10570
4797 7172
11338 19191
12025 15220
6101 14741
13743 19439
18584 18585
8084 9348
2472 13697
8340 15234
12601 14579
11460 18455
812 10636
2615 6470
12045 18063
11672 15845
1920 16309
10991 12587
1471 10310
4685 9070
327 5847
1778 15356
3...

output:

0 1 1 0 1 1 1 1 0 0 0 1 1 1 0 0 0 1 1 0 0 1 1 0 1 1 1 1 0 0 1 0 1 1 1 0 1 0 0 1 1 0 1 0 1 1 1 0 0 0 0 1 1 0 1 0 0 0 0 1 0 0 0 1 1 1 1 0 0 1 1 0 1 0 0 1 1 0 0 1 1 1 1 0 0 0 1 0 1 1 1 0 0 0 0 1 0 0 0 0 0 1 0 1 1 1 1 0 0 1 0 0 0 1 0 1 0 0 1 0 1 0 0 1 0 0 0 1 0 0 0 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 1 1 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 7017

result:

ok Number of moves = 7017

Test #116:

score: 71
Accepted
time: 18ms
memory: 9804kb

input:

19999 19998 2 12 15292
3335 11827
14258 18043
2601 8536
5039 10570
4797 7172
11338 19191
12025 15220
6101 14741
13743 19439
18584 18585
8084 9348
2472 13697
8340 15234
12601 14579
11460 18455
812 10636
2615 6470
12045 18063
11672 15845
1920 16309
10991 12587
1471 10310
4685 9070
327 5847
1778 15356
...

output:

0 1 1 0 1 1 1 1 0 0 0 1 1 1 0 0 0 1 1 0 0 1 1 0 1 1 1 1 0 0 1 0 1 1 1 0 1 0 0 1 1 0 1 0 1 1 1 0 0 0 0 1 1 0 1 0 0 0 0 1 0 0 0 1 1 1 1 0 0 1 1 0 1 0 0 1 1 0 0 1 1 1 1 0 0 0 1 0 1 1 1 0 0 0 0 1 0 0 0 0 0 1 0 1 1 1 1 0 0 1 0 0 0 1 0 1 0 0 1 0 1 0 0 1 0 0 0 1 0 0 0 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 1 1 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 7022

result:

ok Number of moves = 7022

Test #117:

score: 71
Accepted
time: 24ms
memory: 9508kb

input:

19999 19998 2 12 5574
3335 11827
14258 18043
2601 8536
5039 10570
4797 7172
11338 19191
12025 15220
6101 14741
13743 19439
18584 18585
8084 9348
2472 13697
8340 15234
12601 14579
11460 18455
812 10636
2615 6470
12045 18063
11672 15845
1920 16309
10991 12587
1471 10310
4685 9070
327 5847
1778 15356
3...

output:

0 1 1 0 1 1 1 1 0 0 0 1 1 1 0 0 0 1 1 0 0 1 1 0 1 1 1 1 0 0 1 0 1 1 1 0 1 0 0 1 1 0 1 0 1 1 1 0 0 0 0 1 1 0 1 0 0 0 0 1 0 0 0 1 1 1 1 0 0 1 1 0 1 0 0 1 1 0 0 1 1 1 1 0 0 0 1 0 1 1 1 0 0 0 0 1 0 0 0 0 0 1 0 1 1 1 1 0 0 1 0 0 0 1 0 1 0 0 1 0 1 0 0 1 0 0 0 1 0 0 0 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 1 1 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 5000

result:

ok Number of moves = 5000

Test #118:

score: 71
Accepted
time: 12ms
memory: 9728kb

input:

19999 19998 2 12 2460
3335 11827
14258 18043
2601 8536
5039 10570
4797 7172
11338 19191
12025 15220
6101 14741
13743 19439
18584 18585
8084 9348
2472 13697
8340 15234
12601 14579
11460 18455
812 10636
2615 6470
12045 18063
11672 15845
1920 16309
10991 12587
1471 10310
4685 9070
327 5847
1778 15356
3...

output:

0 1 1 0 1 1 1 1 0 0 0 1 1 1 0 0 0 1 1 0 0 1 1 0 1 1 1 1 0 0 1 0 1 1 1 0 1 0 0 1 1 0 1 0 1 1 1 0 0 0 0 1 1 0 1 0 0 0 0 1 0 0 0 1 1 1 1 0 0 1 1 0 1 0 0 1 1 0 0 1 1 1 1 0 0 0 1 0 1 1 1 0 0 0 0 1 0 0 0 0 0 1 0 1 1 1 1 0 0 1 0 0 0 1 0 1 0 0 1 0 1 0 0 1 0 0 0 1 0 0 0 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 1 1 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 7998

result:

ok Number of moves = 7998

Test #119:

score: 71
Accepted
time: 14ms
memory: 9528kb

input:

19999 19998 2 12 7844
12285 17739
9112 14220
12967 15558
2934 3267
1542 17001
182 9154
17961 19135
3948 15970
8368 9313
17477 17837
6383 11896
1019 16509
12903 14845
6632 10569
15133 16574
9856 11038
4144 9622
10272 19413
6235 16965
12150 17227
10498 15376
10222 11827
5406 14681
6342 10288
8135 1619...

output:

1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 1 1 1 1 0 0 1 0 1 1 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 1 0 1 0 1 1 1 0 1 0 0 0 1 0 1 0 1 0 1 0 1 1 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 1 0 0 1 1 0 1 0 0 1 1 1 1 1 1 1 0 0 1 1 0 0 0 1 0 0 1 1 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 1 1 0 1 1 0 0 1 0 1 1 0 1 0 0 1 1 0 0 0 1 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 7

result:

ok Number of moves = 7

Test #120:

score: 71
Accepted
time: 6ms
memory: 9692kb

input:

19999 19998 2 12 10181
12285 17739
9112 14220
12967 15558
2934 3267
1542 17001
182 9154
17961 19135
3948 15970
8368 9313
17477 17837
6383 11896
1019 16509
12903 14845
6632 10569
15133 16574
9856 11038
4144 9622
10272 19413
6235 16965
12150 17227
10498 15376
10222 11827
5406 14681
6342 10288
8135 161...

output:

1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 1 1 1 1 0 0 1 0 1 1 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 1 0 1 0 1 1 1 0 1 0 0 0 1 0 1 0 1 0 1 0 1 1 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 1 0 0 1 1 0 1 0 0 1 1 1 1 1 1 1 0 0 1 1 0 0 0 1 0 0 1 1 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 1 1 0 1 1 0 0 1 0 1 1 0 1 0 0 1 1 0 0 0 1 0 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 6

result:

ok Number of moves = 6

Test #121:

score: 71
Accepted
time: 20ms
memory: 9480kb

input:

19997 19996 2 12 2580
10951 16128
145 14434
3879 14009
1195 9988
13660 14498
44 12809
7853 12207
516 3113
3829 19414
6288 11746
11375 19486
8601 19560
18202 19266
13190 13682
1667 11039
9071 19747
8387 13696
7407 17964
16200 17050
12971 15184
11504 18633
287 19906
759 1336
8442 12067
5047 9106
1647 ...

output:

0 1 0 1 1 0 0 0 0 0 0 1 0 1 0 1 0 1 0 0 0 0 1 0 1 1 0 1 1 1 0 0 0 1 1 0 0 0 1 1 1 0 0 1 0 1 1 0 0 1 1 1 1 0 0 0 0 1 0 1 0 0 1 0 1 1 0 0 0 0 1 0 0 1 0 0 1 1 1 1 0 0 1 1 0 0 0 1 0 1 1 1 1 1 1 1 1 0 0 0 0 1 0 1 1 0 0 0 1 1 0 0 0 0 1 0 0 0 0 1 0 1 0 1 1 0 1 0 0 1 0 0 1 0 0 1 1 1 0 1 0 1 1 0 1 0 1 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 15

result:

ok Number of moves = 15

Test #122:

score: 71
Accepted
time: 0ms
memory: 9476kb

input:

19997 19996 2 12 16484
10951 16128
145 14434
3879 14009
1195 9988
13660 14498
44 12809
7853 12207
516 3113
3829 19414
6288 11746
11375 19486
8601 19560
18202 19266
13190 13682
1667 11039
9071 19747
8387 13696
7407 17964
16200 17050
12971 15184
11504 18633
287 19906
759 1336
8442 12067
5047 9106
1647...

output:

0 1 0 1 1 0 0 0 0 0 0 1 0 1 0 1 0 1 0 0 0 0 1 0 1 1 0 1 1 1 0 0 0 1 1 0 0 0 1 1 1 0 0 1 0 1 1 0 0 1 1 1 1 0 0 0 0 1 0 1 0 0 1 0 1 1 0 0 0 0 1 0 0 1 0 0 1 1 1 1 0 0 1 1 0 0 0 1 0 1 1 1 1 1 1 1 1 0 0 0 0 1 0 1 1 0 0 0 1 1 0 0 0 0 1 0 0 0 0 1 0 1 0 1 1 0 1 0 0 1 0 0 1 0 0 1 1 1 0 1 0 1 1 0 1 0 1 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 12

result:

ok Number of moves = 12

Test #123:

score: 71
Accepted
time: 14ms
memory: 9560kb

input:

19995 19994 2 12 11380
8223 13581
16975 18738
3192 14559
14578 17910
3522 6664
12387 12700
7176 11473
16913 18651
17299 19134
4925 6519
2721 12130
298 3632
691 7355
4367 16868
7189 9625
4651 11784
5595 14643
15967 18781
2559 11011
14442 19562
14757 14902
9221 11748
7943 12501
1787 15854
2657 12387
1...

output:

1 0 1 0 1 0 0 0 0 0 1 1 0 1 1 0 0 1 1 1 0 1 0 0 1 1 1 0 1 0 1 1 1 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 0 0 0 0 1 1 0 0 1 0 0 0 1 1 1 0 0 0 0 0 1 1 1 1 1 0 0 0 1 0 0 0 1 1 1 0 0 1 1 1 1 1 0 0 1 1 0 1 0 1 1 0 0 0 0 0 1 1 0 0 0 1 0 1 1 1 0 0 0 1 0 1 0 0 1 0 1 1 0 1 1 1 0 0 0 1 1 1 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 31

result:

ok Number of moves = 31

Test #124:

score: 71
Accepted
time: 0ms
memory: 9540kb

input:

19995 19994 2 12 18034
8223 13581
16975 18738
3192 14559
14578 17910
3522 6664
12387 12700
7176 11473
16913 18651
17299 19134
4925 6519
2721 12130
298 3632
691 7355
4367 16868
7189 9625
4651 11784
5595 14643
15967 18781
2559 11011
14442 19562
14757 14902
9221 11748
7943 12501
1787 15854
2657 12387
1...

output:

1 0 1 0 1 0 0 0 0 0 1 1 0 1 1 0 0 1 1 1 0 1 0 0 1 1 1 0 1 0 1 1 1 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 0 0 0 0 1 1 0 0 1 0 0 0 1 1 1 0 0 0 0 0 1 1 1 1 1 0 0 0 1 0 0 0 1 1 1 0 0 1 1 1 1 1 0 0 1 1 0 1 0 1 1 0 0 0 0 0 1 1 0 0 0 1 0 1 1 1 0 0 0 1 0 1 0 0 1 0 1 1 0 1 1 1 0 0 0 1 1 1 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 30

result:

ok Number of moves = 30

Test #125:

score: 71
Accepted
time: 14ms
memory: 9640kb

input:

19993 19992 2 12 14851
8538 9714
1790 5423
12371 19245
9119 11710
2768 16620
9299 16133
7986 10048
729 14628
5703 16790
5685 6857
4693 11430
11441 17101
5224 7263
10366 14560
4494 17447
504 8394
6595 19805
597 2666
3492 19488
1137 19811
1927 13089
1816 9995
11588 11786
10478 19200
9157 15850
313 738...

output:

1 1 1 1 0 1 1 1 1 0 0 1 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 1 1 1 0 0 1 1 0 1 0 1 0 0 1 1 1 1 0 1 1 0 0 0 0 0 1 1 0 1 0 1 0 1 0 1 0 1 1 1 1 0 0 1 0 0 0 0 0 1 1 1 0 1 1 0 0 1 1 0 0 0 0 1 0 1 1 1 0 1 1 1 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 0 0 1 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 1 0 0 1 1 1 0 1 1 1 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 26

result:

ok Number of moves = 26

Test #126:

score: 71
Accepted
time: 20ms
memory: 9564kb

input:

19993 19992 2 12 18735
8538 9714
1790 5423
12371 19245
9119 11710
2768 16620
9299 16133
7986 10048
729 14628
5703 16790
5685 6857
4693 11430
11441 17101
5224 7263
10366 14560
4494 17447
504 8394
6595 19805
597 2666
3492 19488
1137 19811
1927 13089
1816 9995
11588 11786
10478 19200
9157 15850
313 738...

output:

1 1 1 1 0 1 1 1 1 0 0 1 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 1 1 1 1 0 0 1 1 0 1 0 1 0 0 1 1 1 1 0 1 1 0 0 0 0 0 1 1 0 1 0 1 0 1 0 1 0 1 1 1 1 0 0 1 0 0 0 0 0 1 1 1 0 1 1 0 0 1 1 0 0 0 0 1 0 1 1 1 0 1 1 1 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 0 0 1 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 1 0 0 1 1 1 0 1 1 1 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 29

result:

ok Number of moves = 29

Test #127:

score: 71
Accepted
time: 14ms
memory: 9480kb

input:

19993 19992 2 12 3151
11209 13160
2889 17624
202 3332
1732 2180
14296 15865
2903 11467
2653 6890
2937 9332
4829 19511
952 16998
679 2660
9103 15154
861 3010
4624 14959
3474 14407
10983 15350
1810 2814
12688 19658
14157 15520
492 2187
16163 19228
13406 19514
8227 12701
7229 12832
7942 11943
17502 193...

output:

1 0 0 0 0 0 0 0 0 1 0 1 0 0 1 1 0 0 0 0 1 0 1 0 0 0 1 0 1 0 0 1 1 0 0 1 0 1 0 1 0 1 0 0 0 1 0 1 1 1 1 1 1 0 1 0 1 0 0 1 0 1 0 0 0 0 0 1 0 1 1 1 0 0 1 0 1 0 0 0 0 0 0 1 1 0 1 0 1 0 0 1 1 0 1 1 1 1 1 0 0 1 0 1 0 0 1 1 0 0 0 0 0 1 1 0 0 0 1 1 1 0 1 1 1 1 1 0 0 1 0 0 0 0 1 0 0 0 0 1 1 1 0 1 1 1 0 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 50

result:

ok Number of moves = 50

Test #128:

score: 71
Accepted
time: 20ms
memory: 9464kb

input:

19993 19992 2 12 8820
11209 13160
2889 17624
202 3332
1732 2180
14296 15865
2903 11467
2653 6890
2937 9332
4829 19511
952 16998
679 2660
9103 15154
861 3010
4624 14959
3474 14407
10983 15350
1810 2814
12688 19658
14157 15520
492 2187
16163 19228
13406 19514
8227 12701
7229 12832
7942 11943
17502 193...

output:

1 0 0 0 0 0 0 0 0 1 0 1 0 0 1 1 0 0 0 0 1 0 1 0 0 0 1 0 1 0 0 1 1 0 0 1 0 1 0 1 0 1 0 0 0 1 0 1 1 1 1 1 1 0 1 0 1 0 0 1 0 1 0 0 0 0 0 1 0 1 1 1 0 0 1 0 1 0 0 0 0 0 0 1 1 0 1 0 1 0 0 1 1 0 1 1 1 1 1 0 0 1 0 1 0 0 1 1 0 0 0 0 0 1 1 0 0 0 1 1 1 0 1 1 1 1 1 0 0 1 0 0 0 0 1 0 0 0 0 1 1 1 0 1 1 1 0 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 45

result:

ok Number of moves = 45

Subtask #7:

score: 9
Accepted

Test #129:

score: 9
Accepted
time: 0ms
memory: 9260kb

input:

20000 19999 2 6 7342
316 6377
5633 9242
8601 8623
7861 15798
5457 5677
13098 13574
5624 19611
10193 17778
1275 19154
7173 19354
6365 7184
4174 5183
3639 12340
9502 10882
5944 17443
3243 11926
17109 18374
617 16882
18024 18499
5356 16091
1557 5482
663 18524
10341 16608
579 12373
6938 14866
9298 11755...

output:

1 1 1 0 0 0 0 1 1 0 0 1 1 0 1 0 0 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0 0 0 1 1 0 0 1 1 0 0 0 1 0 0 1 0 0 0 0 1 1 1 1 0 1 0 0 1 1 0 0 1 0 1 1 0 1 0 1 1 0 0 1 1 1 1 1 1 1 0 1 0 1 1 1 1 0 1 0 0 1 1 1 0 1 1 1 0 0 0 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 1 0 0 0 1 1 1 0 1 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 43

result:

ok Number of moves = 43

Test #130:

score: 9
Accepted
time: 24ms
memory: 9572kb

input:

20000 19999 2 6 10559
1595 7629
6725 14176
2703 14396
6899 8859
4264 6948
8086 19786
12778 18916
16408 18823
2759 13248
11398 15943
3135 17554
1162 1387
4317 11107
871 14814
9203 15536
3942 5142
7687 7908
2364 3960
2494 12254
5272 19793
10843 15814
2794 5324
2452 19565
4904 7426
6757 16330
4233 9844...

output:

1 1 1 0 1 1 0 0 1 1 0 0 1 0 0 1 0 0 0 0 1 0 0 1 1 0 0 0 0 0 1 1 0 0 0 1 0 1 1 1 1 1 0 1 0 1 0 0 0 0 0 0 0 1 1 1 1 0 1 0 1 1 1 0 0 0 1 1 1 0 1 1 1 0 1 1 1 0 0 0 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 1 0 1 1 1 0 1 1 0 0 0 1 1 1 0 0 1 1 0 0 0 0 1 1 0 1 0 0 1 1 0 1 1 1 0 0 0 0 1 0 0 1 1 1 1 0 0 0 0 0 0 1 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 4124

result:

ok Number of moves = 4124

Test #131:

score: 9
Accepted
time: 0ms
memory: 4340kb

input:

2 1 2 6 1
0 1

output:

1 

input:

Interaction has been finished!

output:

Number of moves = 1

result:

ok Number of moves = 1

Test #132:

score: 9
Accepted
time: 8ms
memory: 9532kb

input:

20000 19999 2 6 12999
605 12999
0 18109
12999 17963
12999 15393
0 4958
12999 14472
0 174
0 18220
4367 12999
0 3795
0 7560
0 2103
0 7479
0 4924
12999 14020
0 8910
0 5932
4351 12999
0 3769
12999 14402
0 19726
12999 13325
0 4597
12999 16890
11141 12999
0 11300
12999 17010
1676 12999
12999 18338
12999 1...

output:

0 1 0 0 1 0 1 1 0 1 1 1 1 1 0 1 1 0 1 0 1 0 1 0 0 1 0 0 0 0 0 0 0 0 1 1 0 1 1 1 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 1 0 0 1 1 1 1 0 1 0 1 0 1 0 1 0 1 1 0 1 1 0 1 0 1 1 1 1 0 1 1 1 1 0 0 0 0 0 1 1 0 1 1 1 1 0 1 1 0 0 0 0 1 0 1 1 0 1 1 0 1 1 1 1 1 1 0 0 1 1 0 1 0 0 1 0 1 1 0 1 0 0 0 1 1 1 0 0 0 0 1 1 0 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 1

result:

ok Number of moves = 1

Test #133:

score: 9
Accepted
time: 34ms
memory: 10352kb

input:

19998 19997 2 6 157
8540 15177
14391 16019
813 7864
590 15623
8500 14833
6667 18258
3910 18535
2648 14080
2053 19699
11423 15789
9001 16856
2990 19589
7011 12518
1966 6038
4028 18774
5745 17287
5381 17911
5699 11893
6846 16586
3943 7971
744 2799
8723 14968
18697 18817
13880 15620
381 15096
2299 4630...

output:

0 0 0 0 1 1 0 0 0 0 0 1 0 0 1 1 1 1 0 0 0 1 1 1 0 0 1 0 1 1 0 1 1 1 1 0 1 0 1 1 1 0 1 1 0 0 1 0 1 0 1 0 0 1 1 1 0 0 0 0 0 1 0 1 1 0 1 1 1 0 0 0 0 0 1 0 1 0 0 0 1 1 1 0 0 1 1 1 1 0 1 0 1 1 1 0 0 0 1 1 0 1 1 1 0 1 0 1 1 0 0 0 1 1 1 0 1 1 0 0 1 1 0 0 0 1 1 0 0 0 0 0 1 0 1 1 0 1 0 1 0 0 1 1 1 1 1 1 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 19997

result:

ok Number of moves = 19997

Test #134:

score: 9
Accepted
time: 34ms
memory: 10524kb

input:

19998 19997 2 6 16368
8540 15177
14391 16019
813 7864
590 15623
8500 14833
6667 18258
3910 18535
2648 14080
2053 19699
11423 15789
9001 16856
2990 19589
7011 12518
1966 6038
4028 18774
5745 17287
5381 17911
5699 11893
6846 16586
3943 7971
744 2799
8723 14968
18697 18817
13880 15620
381 15096
2299 46...

output:

0 0 0 0 1 1 0 0 0 0 0 1 0 0 1 1 1 1 0 0 0 1 1 1 0 0 1 0 1 1 0 1 1 1 1 0 1 0 1 1 1 0 1 1 0 0 1 0 1 0 1 0 0 1 1 1 0 0 0 0 0 1 0 1 1 0 1 1 1 0 0 0 0 0 1 0 1 0 0 0 1 1 1 0 0 1 1 1 1 0 1 0 1 1 1 0 0 0 1 1 0 1 1 1 0 1 0 1 1 0 0 0 1 1 1 0 1 1 0 0 1 1 0 0 0 1 1 0 0 0 0 0 1 0 1 1 0 1 0 1 0 0 1 1 1 1 1 1 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 19996

result:

ok Number of moves = 19996

Test #135:

score: 9
Accepted
time: 14ms
memory: 9760kb

input:

19998 19997 2 6 7477
8540 15177
14391 16019
813 7864
590 15623
8500 14833
6667 18258
3910 18535
2648 14080
2053 19699
11423 15789
9001 16856
2990 19589
7011 12518
1966 6038
4028 18774
5745 17287
5381 17911
5699 11893
6846 16586
3943 7971
744 2799
8723 14968
18697 18817
13880 15620
381 15096
2299 463...

output:

0 0 0 0 1 1 0 0 0 0 0 1 0 0 1 1 1 1 0 0 0 1 1 1 0 0 1 0 1 1 0 1 1 1 1 0 1 0 1 1 1 0 1 1 0 0 1 0 1 0 1 0 0 1 1 1 0 0 0 0 0 1 0 1 1 0 1 1 1 0 0 0 0 0 1 0 1 0 0 0 1 1 1 0 0 1 1 1 1 0 1 0 1 1 1 0 0 0 1 1 0 1 1 1 0 1 0 1 1 0 0 0 1 1 1 0 1 1 0 0 1 1 0 0 0 1 1 0 0 0 0 0 1 0 1 1 0 1 0 1 0 0 1 1 1 1 1 1 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 999

result:

ok Number of moves = 999

Test #136:

score: 9
Accepted
time: 22ms
memory: 9676kb

input:

19998 19997 2 6 6883
8540 15177
14391 16019
813 7864
590 15623
8500 14833
6667 18258
3910 18535
2648 14080
2053 19699
11423 15789
9001 16856
2990 19589
7011 12518
1966 6038
4028 18774
5745 17287
5381 17911
5699 11893
6846 16586
3943 7971
744 2799
8723 14968
18697 18817
13880 15620
381 15096
2299 463...

output:

0 0 0 0 1 1 0 0 0 0 0 1 0 0 1 1 1 1 0 0 0 1 1 1 0 0 1 0 1 1 0 1 1 1 1 0 1 0 1 1 1 0 1 1 0 0 1 0 1 0 1 0 0 1 1 1 0 0 0 0 0 1 0 1 1 0 1 1 1 0 0 0 0 0 1 0 1 0 0 0 1 1 1 0 0 1 1 1 1 0 1 0 1 1 1 0 0 0 1 1 0 1 1 1 0 1 0 1 1 0 0 0 1 1 1 0 1 1 0 0 1 1 0 0 0 1 1 0 0 0 0 0 1 0 1 1 0 1 0 1 0 0 1 1 1 1 1 1 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 992

result:

ok Number of moves = 992

Test #137:

score: 9
Accepted
time: 32ms
memory: 10272kb

input:

19999 19998 2 6 9771
2475 14167
1240 8400
14188 17312
5839 16029
2954 7471
6588 8631
6513 19107
3060 17402
3636 7957
10847 15796
4847 15818
1118 12671
6834 16452
13410 14652
1517 12947
7118 7266
5047 5235
10681 16683
37 834
13123 13374
1339 10323
13273 14959
1016 19980
7194 9861
2301 4351
921 16478
...

output:

1 0 1 0 1 1 1 0 0 0 0 0 1 1 0 1 0 0 1 0 0 0 0 1 1 1 0 0 0 0 1 0 1 0 1 1 0 1 1 1 0 0 1 0 0 0 1 0 1 1 1 0 0 1 1 1 1 0 1 0 0 1 0 0 1 0 0 1 1 0 1 1 1 0 1 1 1 0 1 0 1 1 0 1 1 0 0 0 1 1 1 0 0 0 1 1 0 1 1 1 1 1 1 0 0 0 0 1 1 0 1 1 1 0 1 0 1 1 0 0 0 0 0 1 1 0 1 1 0 1 1 1 0 0 0 1 0 0 0 0 1 1 1 1 0 1 0 1 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 19998

result:

ok Number of moves = 19998

Test #138:

score: 9
Accepted
time: 8ms
memory: 10600kb

input:

19999 19998 2 6 6447
2475 14167
1240 8400
14188 17312
5839 16029
2954 7471
6588 8631
6513 19107
3060 17402
3636 7957
10847 15796
4847 15818
1118 12671
6834 16452
13410 14652
1517 12947
7118 7266
5047 5235
10681 16683
37 834
13123 13374
1339 10323
13273 14959
1016 19980
7194 9861
2301 4351
921 16478
...

output:

1 0 1 0 1 1 1 0 0 0 0 0 1 1 0 1 0 0 1 0 0 0 0 1 1 1 0 0 0 0 1 0 1 0 1 1 0 1 1 1 0 0 1 0 0 0 1 0 1 1 1 0 0 1 1 1 1 0 1 0 0 1 0 0 1 0 0 1 1 0 1 1 1 0 1 1 1 0 1 0 1 1 0 1 1 0 0 0 1 1 1 0 0 0 1 1 0 1 1 1 1 1 1 0 0 0 0 1 1 0 1 1 1 0 1 0 1 1 0 0 0 0 0 1 1 0 1 1 0 1 1 1 0 0 0 1 0 0 0 0 1 1 1 1 0 1 0 1 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 19997

result:

ok Number of moves = 19997

Test #139:

score: 9
Accepted
time: 24ms
memory: 10360kb

input:

20000 19999 2 6 13876
19022 19751
10701 17954
2100 9336
1160 18064
778 9780
8724 19686
2324 4646
14044 18168
515 4837
5261 11443
1588 4784
7699 8137
1096 11339
10271 10769
16608 18983
2063 13987
15521 16324
147 13054
6200 13335
7389 19253
13536 17226
13270 13559
11043 16012
9696 18290
11726 14467
11...

output:

1 0 1 0 1 1 1 0 1 0 0 1 1 1 1 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 0 1 1 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 1 0 1 0 1 1 1 0 1 1 0 1 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 0 0 1 1 0 1 0 0 1 0 0 0 0 0 1 0 0 1 1 1 0 1 0 1 1 0 0 0 0 1 1 1 0 0 1 0 1 1 1 1 0 1 1 1 1 0 0 0 0 1 1 0 1 1 1 1 1 0 1 0 1 0 1 1 1 0 0 0 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 19999

result:

ok Number of moves = 19999

Test #140:

score: 9
Accepted
time: 26ms
memory: 10356kb

input:

20000 19999 2 6 16403
19022 19751
10701 17954
2100 9336
1160 18064
778 9780
8724 19686
2324 4646
14044 18168
515 4837
5261 11443
1588 4784
7699 8137
1096 11339
10271 10769
16608 18983
2063 13987
15521 16324
147 13054
6200 13335
7389 19253
13536 17226
13270 13559
11043 16012
9696 18290
11726 14467
11...

output:

1 0 1 0 1 1 1 0 1 0 0 1 1 1 1 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 0 1 1 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 1 0 1 0 1 1 1 0 1 1 0 1 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 0 0 1 1 0 1 0 0 1 0 0 0 0 0 1 0 0 1 1 1 0 1 0 1 1 0 0 0 0 1 1 1 0 0 1 0 1 1 1 1 0 1 1 1 1 0 0 0 0 1 1 0 1 1 1 1 1 0 1 0 1 0 1 1 1 0 0 0 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 20000

result:

ok Number of moves = 20000

Test #141:

score: 9
Accepted
time: 32ms
memory: 10480kb

input:

20000 19999 2 6 7313
19022 19751
10701 17954
2100 9336
1160 18064
778 9780
8724 19686
2324 4646
14044 18168
515 4837
5261 11443
1588 4784
7699 8137
1096 11339
10271 10769
16608 18983
2063 13987
15521 16324
147 13054
6200 13335
7389 19253
13536 17226
13270 13559
11043 16012
9696 18290
11726 14467
112...

output:

1 0 1 0 1 1 1 0 1 0 0 1 1 1 1 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 0 1 1 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 1 0 1 0 1 1 1 0 1 1 0 1 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 0 0 1 1 0 1 0 0 1 0 0 0 0 0 1 0 0 1 1 1 0 1 0 1 1 0 0 0 0 1 1 1 0 0 1 0 1 1 1 1 0 1 1 1 1 0 0 0 0 1 1 0 1 1 1 1 1 0 1 0 1 0 1 1 1 0 0 0 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 20001

result:

ok Number of moves = 20001

Test #142:

score: 9
Accepted
time: 32ms
memory: 10548kb

input:

20000 19999 2 6 16687
19022 19751
10701 17954
2100 9336
1160 18064
778 9780
8724 19686
2324 4646
14044 18168
515 4837
5261 11443
1588 4784
7699 8137
1096 11339
10271 10769
16608 18983
2063 13987
15521 16324
147 13054
6200 13335
7389 19253
13536 17226
13270 13559
11043 16012
9696 18290
11726 14467
11...

output:

1 0 1 0 1 1 1 0 1 0 0 1 1 1 1 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 0 1 1 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 1 0 1 0 1 1 1 0 1 1 0 1 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 0 0 1 1 0 1 0 0 1 0 0 0 0 0 1 0 0 1 1 1 0 1 0 1 1 0 0 0 0 1 1 1 0 0 1 0 1 1 1 1 0 1 1 1 1 0 0 0 0 1 1 0 1 1 1 1 1 0 1 0 1 0 1 1 1 0 0 0 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 19996

result:

ok Number of moves = 19996

Test #143:

score: 9
Accepted
time: 24ms
memory: 10352kb

input:

20000 19999 2 6 7103
19022 19751
10701 17954
2100 9336
1160 18064
778 9780
8724 19686
2324 4646
14044 18168
515 4837
5261 11443
1588 4784
7699 8137
1096 11339
10271 10769
16608 18983
2063 13987
15521 16324
147 13054
6200 13335
7389 19253
13536 17226
13270 13559
11043 16012
9696 18290
11726 14467
112...

output:

1 0 1 0 1 1 1 0 1 0 0 1 1 1 1 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 0 1 1 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 1 0 1 0 1 1 1 0 1 1 0 1 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 0 0 1 1 0 1 0 0 1 0 0 0 0 0 1 0 0 1 1 1 0 1 0 1 1 0 0 0 0 1 1 1 0 0 1 0 1 1 1 1 0 1 1 1 1 0 0 0 0 1 1 0 1 1 1 1 1 0 1 0 1 0 1 1 1 0 0 0 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 19999

result:

ok Number of moves = 19999

Test #144:

score: 9
Accepted
time: 14ms
memory: 10528kb

input:

20000 19999 2 6 9210
19022 19751
10701 17954
2100 9336
1160 18064
778 9780
8724 19686
2324 4646
14044 18168
515 4837
5261 11443
1588 4784
7699 8137
1096 11339
10271 10769
16608 18983
2063 13987
15521 16324
147 13054
6200 13335
7389 19253
13536 17226
13270 13559
11043 16012
9696 18290
11726 14467
112...

output:

1 0 1 0 1 1 1 0 1 0 0 1 1 1 1 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 0 1 1 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 1 0 1 0 1 1 1 0 1 1 0 1 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 0 0 1 1 0 1 0 0 1 0 0 0 0 0 1 0 0 1 1 1 0 1 0 1 1 0 0 0 0 1 1 1 0 0 1 0 1 1 1 1 0 1 1 1 1 0 0 0 0 1 1 0 1 1 1 1 1 0 1 0 1 0 1 1 1 0 0 0 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 19994

result:

ok Number of moves = 19994

Test #145:

score: 9
Accepted
time: 30ms
memory: 10008kb

input:

20000 19999 2 6 6634
19022 19751
10701 17954
2100 9336
1160 18064
778 9780
8724 19686
2324 4646
14044 18168
515 4837
5261 11443
1588 4784
7699 8137
1096 11339
10271 10769
16608 18983
2063 13987
15521 16324
147 13054
6200 13335
7389 19253
13536 17226
13270 13559
11043 16012
9696 18290
11726 14467
112...

output:

1 0 1 0 1 1 1 0 1 0 0 1 1 1 1 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 0 1 1 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 1 0 1 0 1 1 1 0 1 1 0 1 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 0 0 1 1 0 1 0 0 1 0 0 0 0 0 1 0 0 1 1 1 0 1 0 1 1 0 0 0 0 1 1 1 0 0 1 0 1 1 1 1 0 1 1 1 1 0 0 0 0 1 1 0 1 1 1 1 1 0 1 0 1 0 1 1 1 0 0 0 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 13341

result:

ok Number of moves = 13341

Test #146:

score: 9
Accepted
time: 28ms
memory: 10008kb

input:

20000 19999 2 6 2832
19022 19751
10701 17954
2100 9336
1160 18064
778 9780
8724 19686
2324 4646
14044 18168
515 4837
5261 11443
1588 4784
7699 8137
1096 11339
10271 10769
16608 18983
2063 13987
15521 16324
147 13054
6200 13335
7389 19253
13536 17226
13270 13559
11043 16012
9696 18290
11726 14467
112...

output:

1 0 1 0 1 1 1 0 1 0 0 1 1 1 1 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 0 1 1 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 1 0 1 0 1 1 1 0 1 1 0 1 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 0 0 1 1 0 1 0 0 1 0 0 0 0 0 1 0 0 1 1 1 0 1 0 1 1 0 0 0 0 1 1 1 0 0 1 0 1 1 1 1 0 1 1 1 1 0 0 0 0 1 1 0 1 1 1 1 1 0 1 0 1 0 1 1 1 0 0 0 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 13336

result:

ok Number of moves = 13336

Test #147:

score: 9
Accepted
time: 30ms
memory: 10008kb

input:

20000 19999 2 6 5359
19022 19751
10701 17954
2100 9336
1160 18064
778 9780
8724 19686
2324 4646
14044 18168
515 4837
5261 11443
1588 4784
7699 8137
1096 11339
10271 10769
16608 18983
2063 13987
15521 16324
147 13054
6200 13335
7389 19253
13536 17226
13270 13559
11043 16012
9696 18290
11726 14467
112...

output:

1 0 1 0 1 1 1 0 1 0 0 1 1 1 1 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 0 1 1 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 1 0 1 0 1 1 1 0 1 1 0 1 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 0 0 1 1 0 1 0 0 1 0 0 0 0 0 1 0 0 1 1 1 0 1 0 1 1 0 0 0 0 1 1 1 0 0 1 0 1 1 1 1 0 1 1 1 1 0 0 0 0 1 1 0 1 1 1 1 1 0 1 0 1 0 1 1 1 0 0 0 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 13339

result:

ok Number of moves = 13339

Test #148:

score: 9
Accepted
time: 22ms
memory: 10072kb

input:

20000 19999 2 6 13535
19022 19751
10701 17954
2100 9336
1160 18064
778 9780
8724 19686
2324 4646
14044 18168
515 4837
5261 11443
1588 4784
7699 8137
1096 11339
10271 10769
16608 18983
2063 13987
15521 16324
147 13054
6200 13335
7389 19253
13536 17226
13270 13559
11043 16012
9696 18290
11726 14467
11...

output:

1 0 1 0 1 1 1 0 1 0 0 1 1 1 1 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 0 1 1 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 1 0 1 0 1 1 1 0 1 1 0 1 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 0 0 1 1 0 1 0 0 1 0 0 0 0 0 1 0 0 1 1 1 0 1 0 1 1 0 0 0 0 1 1 1 0 0 1 0 1 1 1 1 0 1 1 1 1 0 0 0 0 1 1 0 1 1 1 1 1 0 1 0 1 0 1 1 1 0 0 0 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 13334

result:

ok Number of moves = 13334

Test #149:

score: 9
Accepted
time: 30ms
memory: 10080kb

input:

20000 19999 2 6 9129
19022 19751
10701 17954
2100 9336
1160 18064
778 9780
8724 19686
2324 4646
14044 18168
515 4837
5261 11443
1588 4784
7699 8137
1096 11339
10271 10769
16608 18983
2063 13987
15521 16324
147 13054
6200 13335
7389 19253
13536 17226
13270 13559
11043 16012
9696 18290
11726 14467
112...

output:

1 0 1 0 1 1 1 0 1 0 0 1 1 1 1 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 0 1 1 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 1 0 1 0 1 1 1 0 1 1 0 1 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 0 0 1 1 0 1 0 0 1 0 0 0 0 0 1 0 0 1 1 1 0 1 0 1 1 0 0 0 0 1 1 1 0 0 1 0 1 1 1 1 0 1 1 1 1 0 0 0 0 1 1 0 1 1 1 1 1 0 1 0 1 0 1 1 1 0 0 0 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 13337

result:

ok Number of moves = 13337

Test #150:

score: 9
Accepted
time: 28ms
memory: 10012kb

input:

20000 19999 2 6 19461
19022 19751
10701 17954
2100 9336
1160 18064
778 9780
8724 19686
2324 4646
14044 18168
515 4837
5261 11443
1588 4784
7699 8137
1096 11339
10271 10769
16608 18983
2063 13987
15521 16324
147 13054
6200 13335
7389 19253
13536 17226
13270 13559
11043 16012
9696 18290
11726 14467
11...

output:

1 0 1 0 1 1 1 0 1 0 0 1 1 1 1 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 0 1 1 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 1 0 1 0 1 1 1 0 1 1 0 1 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 0 0 1 1 0 1 0 0 1 0 0 0 0 0 1 0 0 1 1 1 0 1 0 1 1 0 0 0 0 1 1 1 0 0 1 0 1 1 1 1 0 1 1 1 1 0 0 0 0 1 1 0 1 1 1 1 1 0 1 0 1 0 1 1 1 0 0 0 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 13338

result:

ok Number of moves = 13338

Test #151:

score: 9
Accepted
time: 0ms
memory: 9496kb

input:

19998 19997 2 6 4130
4877 19953
13529 14984
14100 15420
9282 14188
2001 16271
1782 12862
10950 11464
9961 12125
1171 18068
15431 18253
1769 4672
18125 18809
14738 15356
3936 15229
4438 16461
225 19193
3682 11771
1339 11751
9959 9975
10113 12954
2025 18259
4223 17377
1062 16024
10468 16863
13106 1334...

output:

1 0 0 0 1 1 0 0 0 0 1 1 0 0 1 1 1 1 0 1 0 0 1 0 1 1 0 0 0 0 1 1 0 1 0 0 0 1 0 0 0 1 1 0 0 0 1 1 1 0 1 0 1 0 0 1 1 1 0 0 1 1 1 1 1 0 0 1 0 0 0 1 1 0 1 1 0 0 1 1 1 0 0 0 0 1 1 1 0 1 1 0 0 1 0 1 1 1 1 0 0 1 1 0 0 0 1 1 1 1 1 1 0 0 1 0 1 0 0 0 0 1 0 1 1 1 0 1 1 0 0 0 0 1 0 1 1 1 0 1 0 1 1 0 1 1 1 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 34

result:

ok Number of moves = 34

Test #152:

score: 9
Accepted
time: 20ms
memory: 9292kb

input:

19998 19997 2 6 2158
4877 19953
13529 14984
14100 15420
9282 14188
2001 16271
1782 12862
10950 11464
9961 12125
1171 18068
15431 18253
1769 4672
18125 18809
14738 15356
3936 15229
4438 16461
225 19193
3682 11771
1339 11751
9959 9975
10113 12954
2025 18259
4223 17377
1062 16024
10468 16863
13106 1334...

output:

1 0 0 0 1 1 0 0 0 0 1 1 0 0 1 1 1 1 0 1 0 0 1 0 1 1 0 0 0 0 1 1 0 1 0 0 0 1 0 0 0 1 1 0 0 0 1 1 1 0 1 0 1 0 0 1 1 1 0 0 1 1 1 1 1 0 0 1 0 0 0 1 1 0 1 1 0 0 1 1 1 0 0 0 0 1 1 1 0 1 1 0 0 1 0 1 1 1 1 0 0 1 1 0 0 0 1 1 1 1 1 1 0 0 1 0 1 0 0 0 0 1 0 1 1 1 0 1 1 0 0 0 0 1 0 1 1 1 0 1 0 1 1 0 1 1 1 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 29

result:

ok Number of moves = 29

Test #153:

score: 9
Accepted
time: 14ms
memory: 9468kb

input:

19998 19997 2 6 6952
658 842
2047 12318
321 15247
51 14027
7026 15800
13828 16751
2266 14771
2721 12904
5447 14908
12329 14769
10611 16569
732 13399
1505 10499
11212 16298
11836 15509
3061 10513
2864 11586
3096 5065
14156 18830
12649 15890
16628 17695
3054 15041
6075 8744
3643 5627
13370 18375
2588 ...

output:

1 1 0 0 0 0 1 1 0 1 1 1 1 1 1 0 1 0 1 0 1 0 1 0 0 1 1 1 0 0 1 1 1 0 1 1 0 0 0 0 0 1 1 0 1 1 0 1 0 0 1 0 1 1 1 0 0 1 1 1 0 0 0 1 0 1 1 1 1 0 1 0 0 0 0 0 0 1 1 1 0 0 1 0 1 0 1 0 0 0 1 1 0 0 0 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 0 1 0 0 0 0 0 0 1 1 0 1 0 0 1 0 0 1 1 1 1 0 1 1 0 1 1 0 0 1 1 0 0 1 1 0 1 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 2002

result:

ok Number of moves = 2002

Test #154:

score: 9
Accepted
time: 22ms
memory: 9536kb

input:

19998 19997 2 6 7219
658 842
2047 12318
321 15247
51 14027
7026 15800
13828 16751
2266 14771
2721 12904
5447 14908
12329 14769
10611 16569
732 13399
1505 10499
11212 16298
11836 15509
3061 10513
2864 11586
3096 5065
14156 18830
12649 15890
16628 17695
3054 15041
6075 8744
3643 5627
13370 18375
2588 ...

output:

1 1 0 0 0 0 1 1 0 1 1 1 1 1 1 0 1 0 1 0 1 0 1 0 0 1 1 1 0 0 1 1 1 0 1 1 0 0 0 0 0 1 1 0 1 1 0 1 0 0 1 0 1 1 1 0 0 1 1 1 0 0 0 1 0 1 1 1 1 0 1 0 0 0 0 0 0 1 1 1 0 0 1 0 1 0 1 0 0 0 1 1 0 0 0 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 0 1 0 0 0 0 0 0 1 1 0 1 0 0 1 0 0 1 1 1 1 0 1 1 0 1 1 0 0 1 1 0 0 1 1 0 1 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 2009

result:

ok Number of moves = 2009

Test #155:

score: 9
Accepted
time: 28ms
memory: 9744kb

input:

19998 19997 2 6 1634
661 15412
4259 15930
9250 12117
11546 16855
3107 11886
8384 15550
7061 14628
12141 19434
3970 13952
11685 14383
11257 17619
5475 8655
9733 17188
16950 18013
3340 11425
2641 6041
1900 14129
2542 11835
5053 9395
1987 6257
6030 8751
1617 8850
16536 18128
11014 19456
5866 7655
4234 ...

output:

0 0 1 1 1 1 1 0 0 0 0 1 1 1 1 0 1 0 1 0 0 1 0 1 0 0 1 1 1 0 0 1 1 0 0 0 0 0 0 1 0 0 0 1 1 0 0 1 1 0 0 1 0 0 1 0 0 0 0 1 0 1 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 1 0 1 1 0 1 0 1 1 0 0 0 1 0 1 0 1 1 0 1 1 1 0 1 0 1 0 1 1 0 1 0 1 0 1 1 1 0 1 1 1 1 0 1 0 0 0 0 0 1 0 1 1 1 0 1 0 0 1 0 0 0 1 1 1 0 1 1 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 10005

result:

ok Number of moves = 10005

Test #156:

score: 9
Accepted
time: 20ms
memory: 9832kb

input:

19998 19997 2 6 8520
661 15412
4259 15930
9250 12117
11546 16855
3107 11886
8384 15550
7061 14628
12141 19434
3970 13952
11685 14383
11257 17619
5475 8655
9733 17188
16950 18013
3340 11425
2641 6041
1900 14129
2542 11835
5053 9395
1987 6257
6030 8751
1617 8850
16536 18128
11014 19456
5866 7655
4234 ...

output:

0 0 1 1 1 1 1 0 0 0 0 1 1 1 1 0 1 0 1 0 0 1 0 1 0 0 1 1 1 0 0 1 1 0 0 0 0 0 0 1 0 0 0 1 1 0 0 1 1 0 0 1 0 0 1 0 0 0 0 1 0 1 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 1 0 1 1 0 1 0 1 1 0 0 0 1 0 1 0 1 1 0 1 1 1 0 1 0 1 0 1 1 0 1 0 1 0 1 1 1 0 1 1 1 1 0 1 0 0 0 0 0 1 0 1 1 1 0 1 0 0 1 0 0 0 1 1 1 0 1 1 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 10010

result:

ok Number of moves = 10010

Test #157:

score: 9
Accepted
time: 18ms
memory: 9840kb

input:

19998 19997 2 6 5109
14605 16057
4804 10287
5311 12861
12333 16827
12334 14952
2424 8025
14077 19700
18653 19520
8630 9493
2956 11187
6319 18220
11513 18100
10247 16636
1871 4281
8245 19244
1167 5277
5427 11021
19733 19824
18473 18489
1807 6602
5371 17697
8750 9872
2570 7862
3565 9650
10059 11151
46...

output:

0 1 1 1 0 1 0 1 1 0 0 1 1 1 0 0 0 0 1 0 0 1 0 0 1 1 0 1 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1 1 0 1 0 0 0 1 1 0 1 0 0 0 1 0 0 1 1 0 1 0 1 1 1 1 1 1 0 1 0 0 1 0 1 0 0 1 1 0 1 1 1 1 0 1 0 1 0 1 1 1 1 1 0 1 1 1 1 0 1 0 1 0 0 0 1 1 0 0 0 1 0 1 0 1 1 1 0 1 1 1 1 1 0 1 0 1 1 1 0 1 0 1 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 10246

result:

ok Number of moves = 10246

Test #158:

score: 9
Accepted
time: 26ms
memory: 9836kb

input:

19998 19997 2 6 17145
14605 16057
4804 10287
5311 12861
12333 16827
12334 14952
2424 8025
14077 19700
18653 19520
8630 9493
2956 11187
6319 18220
11513 18100
10247 16636
1871 4281
8245 19244
1167 5277
5427 11021
19733 19824
18473 18489
1807 6602
5371 17697
8750 9872
2570 7862
3565 9650
10059 11151
4...

output:

0 1 1 1 0 1 0 1 1 0 0 1 1 1 0 0 0 0 1 0 0 1 0 0 1 1 0 1 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1 1 0 1 0 0 0 1 1 0 1 0 0 0 1 0 0 1 1 0 1 0 1 1 1 1 1 1 0 1 0 0 1 0 1 0 0 1 1 0 1 1 1 1 0 1 0 1 0 1 1 1 1 1 0 1 1 1 1 0 1 0 1 0 0 0 1 1 0 0 0 1 0 1 0 1 1 1 0 1 1 1 1 1 0 1 0 1 1 1 0 1 0 1 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 10249

result:

ok Number of moves = 10249

Test #159:

score: 9
Accepted
time: 0ms
memory: 9264kb

input:

20000 19999 2 6 19120
4805 6873
235 17151
11255 13221
551 3020
1594 14042
2359 7815
7132 12522
4718 6455
2004 18795
2772 16380
13309 15497
7512 19215
309 8992
4574 9006
9131 19467
14410 17735
1768 15599
8347 14339
2236 16408
8034 10487
6297 9026
14065 16193
9658 15443
32 19055
2018 16490
13858 15636...

output:

0 0 0 0 1 1 1 0 1 1 0 0 1 1 1 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 0 0 1 1 0 0 1 0 0 1 0 1 0 1 0 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 0 1 0 1 1 0 1 1 0 0 0 0 1 0 1 0 0 1 1 0 0 0 0 1 0 0 1 1 0 0 1 1 0 1 1 1 1 0 1 1 0 0 0 0 1 0 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 0 1 1 1 1 0 1 0 0 0 0 1 1 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 57

result:

ok Number of moves = 57

Test #160:

score: 9
Accepted
time: 14ms
memory: 9268kb

input:

20000 19999 2 6 9851
4805 6873
235 17151
11255 13221
551 3020
1594 14042
2359 7815
7132 12522
4718 6455
2004 18795
2772 16380
13309 15497
7512 19215
309 8992
4574 9006
9131 19467
14410 17735
1768 15599
8347 14339
2236 16408
8034 10487
6297 9026
14065 16193
9658 15443
32 19055
2018 16490
13858 15636
...

output:

0 0 0 0 1 1 1 0 1 1 0 0 1 1 1 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 0 0 1 1 0 0 1 0 0 1 0 1 0 1 0 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 0 1 0 1 1 0 1 1 0 0 0 0 1 0 1 0 0 1 1 0 0 0 0 1 0 0 1 1 0 0 1 1 0 1 1 1 1 0 1 1 0 0 0 0 1 0 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 0 1 1 1 1 0 1 0 0 0 0 1 1 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 60

result:

ok Number of moves = 60

Test #161:

score: 9
Accepted
time: 6ms
memory: 9760kb

input:

20000 19999 2 6 5330
4683 10327
15023 17287
15705 16925
4020 11662
1158 9795
1613 13353
2432 7700
10952 18223
5990 6472
1330 8234
19008 19360
1567 14247
162 10436
2005 15140
15101 15995
8777 10375
2885 15510
5979 17404
1457 10560
1599 14929
3 4831
13279 13790
12437 18960
12200 19771
3042 5300
7812 1...

output:

0 0 0 1 1 1 1 1 0 1 1 0 0 1 0 0 0 0 1 1 1 1 0 1 1 1 0 1 1 0 0 0 1 1 0 1 0 0 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 0 0 1 1 0 1 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 0 0 1 1 0 1 1 1 1 0 0 0 1 0 0 1 0 1 1 1 0 1 0 0 1 0 0 0 1 1 0 1 0 1 1 1 0 1 1 1 0 0 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 0 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 2140

result:

ok Number of moves = 2140

Test #162:

score: 9
Accepted
time: 22ms
memory: 9672kb

input:

20000 19999 2 6 3685
4683 10327
15023 17287
15705 16925
4020 11662
1158 9795
1613 13353
2432 7700
10952 18223
5990 6472
1330 8234
19008 19360
1567 14247
162 10436
2005 15140
15101 15995
8777 10375
2885 15510
5979 17404
1457 10560
1599 14929
3 4831
13279 13790
12437 18960
12200 19771
3042 5300
7812 1...

output:

0 0 0 1 1 1 1 1 0 1 1 0 0 1 0 0 0 0 1 1 1 1 0 1 1 1 0 1 1 0 0 0 1 1 0 1 0 0 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 0 0 1 1 0 1 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 0 0 1 1 0 1 1 1 1 0 0 0 1 0 0 1 0 1 1 1 0 1 0 0 1 0 0 0 1 1 0 1 0 1 1 1 0 1 1 1 0 0 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 0 1 1 ...

input:

Interaction has been finished!

output:

Number of moves = 2445

result:

ok Number of moves = 2445

Test #163:

score: 9
Accepted
time: 12ms
memory: 9952kb

input:

20000 19999 2 6 10722
9507 12308
7685 12312
9404 18940
1290 3863
6814 8079
17028 19136
17099 18927
16162 17428
2368 15620
5503 9221
9064 19600
1451 10182
5859 19220
5962 10109
7810 12139
9214 16571
2401 4296
5060 8085
6123 13095
8733 9482
2324 16047
12240 14309
3807 6419
9593 12956
8560 9631
2979 11...

output:

0 1 1 0 0 1 1 1 1 0 1 1 1 1 0 1 1 0 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 0 1 0 1 1 1 0 1 1 1 1 0 1 0 0 0 0 1 1 1 1 0 1 0 1 0 0 0 1 1 0 0 0 1 1 1 1 1 0 1 0 0 0 0 0 1 1 0 1 0 1 0 1 0 1 1 0 0 1 1 1 0 1 1 1 1 1 1 1 0 1 1 0 1 0 0 1 1 0 1 1 1 0 1 0 0 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 0 1 1 1 0 1 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 9001

result:

ok Number of moves = 9001

Test #164:

score: 9
Accepted
time: 26ms
memory: 9900kb

input:

20000 19999 2 6 11960
9507 12308
7685 12312
9404 18940
1290 3863
6814 8079
17028 19136
17099 18927
16162 17428
2368 15620
5503 9221
9064 19600
1451 10182
5859 19220
5962 10109
7810 12139
9214 16571
2401 4296
5060 8085
6123 13095
8733 9482
2324 16047
12240 14309
3807 6419
9593 12956
8560 9631
2979 11...

output:

0 1 1 0 0 1 1 1 1 0 1 1 1 1 0 1 1 0 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 0 1 0 1 1 1 0 1 1 1 1 0 1 0 0 0 0 1 1 1 1 0 1 0 1 0 0 0 1 1 0 0 0 1 1 1 1 1 0 1 0 0 0 0 0 1 1 0 1 0 1 0 1 0 1 1 0 0 1 1 1 0 1 1 1 1 1 1 1 0 1 1 0 1 0 0 1 1 0 1 1 1 0 1 0 0 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 0 1 1 1 0 1 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 9006

result:

ok Number of moves = 9006

Test #165:

score: 9
Accepted
time: 12ms
memory: 9748kb

input:

20000 19999 2 6 7083
9507 12308
7685 12312
9404 18940
1290 3863
6814 8079
17028 19136
17099 18927
16162 17428
2368 15620
5503 9221
9064 19600
1451 10182
5859 19220
5962 10109
7810 12139
9214 16571
2401 4296
5060 8085
6123 13095
8733 9482
2324 16047
12240 14309
3807 6419
9593 12956
8560 9631
2979 118...

output:

0 1 1 0 0 1 1 1 1 0 1 1 1 1 0 1 1 0 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 0 1 0 1 1 1 0 1 1 1 1 0 1 0 0 0 0 1 1 1 1 0 1 0 1 0 0 0 1 1 0 0 0 1 1 1 1 1 0 1 0 0 0 0 0 1 1 0 1 0 1 0 1 0 1 1 0 0 1 1 1 0 1 1 1 1 1 1 1 0 1 1 0 1 0 0 1 1 0 1 1 1 0 1 0 0 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 0 1 1 1 0 1 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 9003

result:

ok Number of moves = 9003

Test #166:

score: 9
Accepted
time: 26ms
memory: 9748kb

input:

20000 19999 2 6 4912
9507 12308
7685 12312
9404 18940
1290 3863
6814 8079
17028 19136
17099 18927
16162 17428
2368 15620
5503 9221
9064 19600
1451 10182
5859 19220
5962 10109
7810 12139
9214 16571
2401 4296
5060 8085
6123 13095
8733 9482
2324 16047
12240 14309
3807 6419
9593 12956
8560 9631
2979 118...

output:

0 1 1 0 0 1 1 1 1 0 1 1 1 1 0 1 1 0 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 0 1 0 1 1 1 0 1 1 1 1 0 1 0 0 0 0 1 1 1 1 0 1 0 1 0 0 0 1 1 0 0 0 1 1 1 1 1 0 1 0 0 0 0 0 1 1 0 1 0 1 0 1 0 1 1 0 0 1 1 1 0 1 1 1 1 1 1 1 0 1 1 0 1 0 0 1 1 0 1 1 1 0 1 0 0 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 0 1 1 1 0 1 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 9008

result:

ok Number of moves = 9008

Test #167:

score: 9
Accepted
time: 20ms
memory: 9744kb

input:

20000 19999 2 6 8136
9507 12308
7685 12312
9404 18940
1290 3863
6814 8079
17028 19136
17099 18927
16162 17428
2368 15620
5503 9221
9064 19600
1451 10182
5859 19220
5962 10109
7810 12139
9214 16571
2401 4296
5060 8085
6123 13095
8733 9482
2324 16047
12240 14309
3807 6419
9593 12956
8560 9631
2979 118...

output:

0 1 1 0 0 1 1 1 1 0 1 1 1 1 0 1 1 0 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 0 1 0 1 1 1 0 1 1 1 1 0 1 0 0 0 0 1 1 1 1 0 1 0 1 0 0 0 1 1 0 0 0 1 1 1 1 1 0 1 0 0 0 0 0 1 1 0 1 0 1 0 1 0 1 1 0 0 1 1 1 0 1 1 1 1 1 1 1 0 1 1 0 1 0 0 1 1 0 1 1 1 0 1 0 0 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 0 1 1 1 0 1 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 9011

result:

ok Number of moves = 9011

Test #168:

score: 9
Accepted
time: 26ms
memory: 9772kb

input:

20000 19999 2 6 4286
9507 12308
7685 12312
9404 18940
1290 3863
6814 8079
17028 19136
17099 18927
16162 17428
2368 15620
5503 9221
9064 19600
1451 10182
5859 19220
5962 10109
7810 12139
9214 16571
2401 4296
5060 8085
6123 13095
8733 9482
2324 16047
12240 14309
3807 6419
9593 12956
8560 9631
2979 118...

output:

0 1 1 0 0 1 1 1 1 0 1 1 1 1 0 1 1 0 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 0 1 0 1 1 1 0 1 1 1 1 0 1 0 0 0 0 1 1 1 1 0 1 0 1 0 0 0 1 1 0 0 0 1 1 1 1 1 0 1 0 0 0 0 0 1 1 0 1 0 1 0 1 0 1 1 0 0 1 1 1 0 1 1 1 1 1 1 1 0 1 1 0 1 0 0 1 1 0 1 1 1 0 1 0 0 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 0 1 1 1 0 1 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 9010

result:

ok Number of moves = 9010

Test #169:

score: 9
Accepted
time: 30ms
memory: 10164kb

input:

20000 19999 2 6 10055
1910 11260
2223 12775
9521 15070
13347 17120
3888 7028
9226 14879
11432 13815
8302 11594
5417 17628
611 7823
9132 19756
11462 18548
8594 11585
12247 19496
1492 6610
2622 6455
1089 10893
2997 9416
16032 16721
3647 5710
4099 8504
7576 11253
7815 19456
4754 10488
1670 6593
268 189...

output:

1 1 1 1 0 1 0 0 1 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1 1 0 1 1 0 1 0 0 0 1 0 0 0 0 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 1 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 0 1 0 1 1 0 0 1 1 1 1 0 0 1 0 1 1 1 0 1 0 1 1 1 1 0 1 1 1 0 1 0 0 1 1 0 1 1 1 1 1 1 0 1 1 0 1 1 0 0 0 0 1 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 13246

result:

ok Number of moves = 13246

Test #170:

score: 9
Accepted
time: 22ms
memory: 10072kb

input:

20000 19999 2 6 2846
1910 11260
2223 12775
9521 15070
13347 17120
3888 7028
9226 14879
11432 13815
8302 11594
5417 17628
611 7823
9132 19756
11462 18548
8594 11585
12247 19496
1492 6610
2622 6455
1089 10893
2997 9416
16032 16721
3647 5710
4099 8504
7576 11253
7815 19456
4754 10488
1670 6593
268 1897...

output:

1 1 1 1 0 1 0 0 1 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1 1 0 1 1 0 1 0 0 0 1 0 0 0 0 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 1 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 0 1 0 1 1 0 0 1 1 1 1 0 0 1 0 1 1 1 0 1 0 1 1 1 1 0 1 1 1 0 1 0 0 1 1 0 1 1 1 1 1 1 0 1 1 0 1 1 0 0 0 0 1 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 13249

result:

ok Number of moves = 13249

Test #171:

score: 9
Accepted
time: 30ms
memory: 10216kb

input:

20000 19999 2 6 9716
1910 11260
2223 12775
9521 15070
13347 17120
3888 7028
9226 14879
11432 13815
8302 11594
5417 17628
611 7823
9132 19756
11462 18548
8594 11585
12247 19496
1492 6610
2622 6455
1089 10893
2997 9416
16032 16721
3647 5710
4099 8504
7576 11253
7815 19456
4754 10488
1670 6593
268 1897...

output:

1 1 1 1 0 1 0 0 1 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1 1 0 1 1 0 1 0 0 0 1 0 0 0 0 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 1 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 0 1 0 1 1 0 0 1 1 1 1 0 0 1 0 1 1 1 0 1 0 1 1 1 1 0 1 1 1 0 1 0 0 1 1 0 1 1 1 1 1 1 0 1 1 0 1 1 0 0 0 0 1 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 13248

result:

ok Number of moves = 13248

Test #172:

score: 9
Accepted
time: 20ms
memory: 10008kb

input:

20000 19999 2 6 5112
1910 11260
2223 12775
9521 15070
13347 17120
3888 7028
9226 14879
11432 13815
8302 11594
5417 17628
611 7823
9132 19756
11462 18548
8594 11585
12247 19496
1492 6610
2622 6455
1089 10893
2997 9416
16032 16721
3647 5710
4099 8504
7576 11253
7815 19456
4754 10488
1670 6593
268 1897...

output:

1 1 1 1 0 1 0 0 1 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1 1 0 1 1 0 1 0 0 0 1 0 0 0 0 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 1 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 0 1 0 1 1 0 0 1 1 1 1 0 0 1 0 1 1 1 0 1 0 1 1 1 1 0 1 1 1 0 1 0 0 1 1 0 1 1 1 1 1 1 0 1 1 0 1 1 0 0 0 0 1 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 14000

result:

ok Number of moves = 14000

Test #173:

score: 9
Accepted
time: 14ms
memory: 10012kb

input:

20000 19999 2 6 7966
1910 11260
2223 12775
9521 15070
13347 17120
3888 7028
9226 14879
11432 13815
8302 11594
5417 17628
611 7823
9132 19756
11462 18548
8594 11585
12247 19496
1492 6610
2622 6455
1089 10893
2997 9416
16032 16721
3647 5710
4099 8504
7576 11253
7815 19456
4754 10488
1670 6593
268 1897...

output:

1 1 1 1 0 1 0 0 1 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1 1 0 1 1 0 1 0 0 0 1 0 0 0 0 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 1 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 0 1 0 1 1 0 0 1 1 1 1 0 0 1 0 1 1 1 0 1 0 1 1 1 1 0 1 1 1 0 1 0 0 1 1 0 1 1 1 1 1 1 0 1 1 0 1 1 0 0 0 0 1 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 13997

result:

ok Number of moves = 13997

Test #174:

score: 9
Accepted
time: 30ms
memory: 10072kb

input:

20000 19999 2 6 6899
1910 11260
2223 12775
9521 15070
13347 17120
3888 7028
9226 14879
11432 13815
8302 11594
5417 17628
611 7823
9132 19756
11462 18548
8594 11585
12247 19496
1492 6610
2622 6455
1089 10893
2997 9416
16032 16721
3647 5710
4099 8504
7576 11253
7815 19456
4754 10488
1670 6593
268 1897...

output:

1 1 1 1 0 1 0 0 1 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1 1 0 1 1 0 1 0 0 0 1 0 0 0 0 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 1 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 0 1 0 1 1 0 0 1 1 1 1 0 0 1 0 1 1 1 0 1 0 1 1 1 1 0 1 1 1 0 1 0 0 1 1 0 1 1 1 1 1 1 0 1 1 0 1 1 0 0 0 0 1 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 14002

result:

ok Number of moves = 14002

Test #175:

score: 9
Accepted
time: 26ms
memory: 9776kb

input:

19999 19998 2 6 3010
7208 8978
6357 17023
1015 16851
13939 19526
15936 19773
6437 14564
2048 3781
7789 15056
517 14985
9565 9644
8693 16341
2938 17686
1984 12560
4807 16715
6454 7751
8583 10409
10599 11704
9904 19646
15963 15987
146 9457
1234 8788
7080 7208
9340 18004
3873 19956
14217 16540
7722 113...

output:

1 1 1 1 0 0 1 1 1 0 1 1 0 0 0 1 0 0 1 1 1 1 1 0 1 1 1 0 1 1 0 1 0 1 0 1 0 0 0 1 0 1 0 0 1 1 1 1 0 0 0 0 1 1 1 0 0 1 0 1 0 0 0 0 0 1 1 0 1 0 0 1 0 1 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0 0 0 1 1 1 1 0 1 1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 1 1 1 1 0 1 1 0 0 1 1 1 0 1 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 1 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 7017

result:

ok Number of moves = 7017

Test #176:

score: 9
Accepted
time: 24ms
memory: 9784kb

input:

19999 19998 2 6 12229
7208 8978
6357 17023
1015 16851
13939 19526
15936 19773
6437 14564
2048 3781
7789 15056
517 14985
9565 9644
8693 16341
2938 17686
1984 12560
4807 16715
6454 7751
8583 10409
10599 11704
9904 19646
15963 15987
146 9457
1234 8788
7080 7208
9340 18004
3873 19956
14217 16540
7722 11...

output:

1 1 1 1 0 0 1 1 1 0 1 1 0 0 0 1 0 0 1 1 1 1 1 0 1 1 1 0 1 1 0 1 0 1 0 1 0 0 0 1 0 1 0 0 1 1 1 1 0 0 0 0 1 1 1 0 0 1 0 1 0 0 0 0 0 1 1 0 1 0 0 1 0 1 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0 0 0 1 1 1 1 0 1 1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 1 1 1 1 0 1 1 0 0 1 1 1 0 1 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 1 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 7022

result:

ok Number of moves = 7022

Test #177:

score: 9
Accepted
time: 22ms
memory: 9560kb

input:

19999 19998 2 6 13659
7208 8978
6357 17023
1015 16851
13939 19526
15936 19773
6437 14564
2048 3781
7789 15056
517 14985
9565 9644
8693 16341
2938 17686
1984 12560
4807 16715
6454 7751
8583 10409
10599 11704
9904 19646
15963 15987
146 9457
1234 8788
7080 7208
9340 18004
3873 19956
14217 16540
7722 11...

output:

1 1 1 1 0 0 1 1 1 0 1 1 0 0 0 1 0 0 1 1 1 1 1 0 1 1 1 0 1 1 0 1 0 1 0 1 0 0 0 1 0 1 0 0 1 1 1 1 0 0 0 0 1 1 1 0 0 1 0 1 0 0 0 0 0 1 1 0 1 0 0 1 0 1 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0 0 0 1 1 1 1 0 1 1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 1 1 1 1 0 1 1 0 0 1 1 1 0 1 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 1 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 5000

result:

ok Number of moves = 5000

Test #178:

score: 9
Accepted
time: 26ms
memory: 9896kb

input:

19999 19998 2 6 13880
7208 8978
6357 17023
1015 16851
13939 19526
15936 19773
6437 14564
2048 3781
7789 15056
517 14985
9565 9644
8693 16341
2938 17686
1984 12560
4807 16715
6454 7751
8583 10409
10599 11704
9904 19646
15963 15987
146 9457
1234 8788
7080 7208
9340 18004
3873 19956
14217 16540
7722 11...

output:

1 1 1 1 0 0 1 1 1 0 1 1 0 0 0 1 0 0 1 1 1 1 1 0 1 1 1 0 1 1 0 1 0 1 0 1 0 0 0 1 0 1 0 0 1 1 1 1 0 0 0 0 1 1 1 0 0 1 0 1 0 0 0 0 0 1 1 0 1 0 0 1 0 1 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0 0 0 1 1 1 1 0 1 1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 1 1 1 1 0 1 1 0 0 1 1 1 0 1 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 1 1 0 ...

input:

Interaction has been finished!

output:

Number of moves = 7998

result:

ok Number of moves = 7998

Test #179:

score: 9
Accepted
time: 20ms
memory: 9572kb

input:

19999 19998 2 6 16769
4231 15743
1926 5594
2239 19592
7148 8605
13090 17277
7110 19686
352 12146
18584 19895
1192 18307
17459 18744
13728 14537
9310 11132
450 18145
8512 15568
6041 8351
8475 9762
944 18832
15416 15574
105 16642
3188 13558
2890 19601
5735 5780
2353 14482
4738 7748
7741 19894
8014 820...

output:

0 0 1 0 1 0 1 1 1 0 0 1 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 0 1 0 1 0 0 0 0 0 0 1 0 0 1 1 1 0 0 1 1 0 0 0 0 0 1 0 1 0 0 1 1 0 0 0 1 0 0 1 0 1 1 1 0 1 1 0 1 1 1 0 0 1 1 1 1 0 0 0 0 1 0 1 1 0 1 1 1 0 1 1 1 0 1 0 1 1 1 0 0 0 1 1 0 1 1 1 1 0 1 0 0 0 1 0 0 0 0 0 1 0 0 1 0 1 0 1 0 0 0 1 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 15

result:

ok Number of moves = 15

Test #180:

score: 9
Accepted
time: 0ms
memory: 9556kb

input:

19999 19998 2 6 523
4231 15743
1926 5594
2239 19592
7148 8605
13090 17277
7110 19686
352 12146
18584 19895
1192 18307
17459 18744
13728 14537
9310 11132
450 18145
8512 15568
6041 8351
8475 9762
944 18832
15416 15574
105 16642
3188 13558
2890 19601
5735 5780
2353 14482
4738 7748
7741 19894
8014 8209
...

output:

0 0 1 0 1 0 1 1 1 0 0 1 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 0 1 0 1 0 0 0 0 0 0 1 0 0 1 1 1 0 0 1 1 0 0 0 0 0 1 0 1 0 0 1 1 0 0 0 1 0 0 1 0 1 1 1 0 1 1 0 1 1 1 0 0 1 1 1 1 0 0 0 0 1 0 1 1 0 1 1 1 0 1 1 1 0 1 0 1 1 1 0 0 0 1 1 0 1 1 1 1 0 1 0 0 0 1 0 0 0 0 0 1 0 0 1 0 1 0 1 0 0 0 1 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 14

result:

ok Number of moves = 14

Test #181:

score: 9
Accepted
time: 20ms
memory: 9636kb

input:

19997 19996 2 6 15251
9849 17565
2236 5372
26 12502
10735 16498
11580 17806
2077 12500
7026 14479
7467 10856
967 9542
4354 7980
3157 7788
2201 5155
3569 9170
3159 5623
3746 17563
15872 16662
18042 18801
6347 7315
13814 18605
6771 10011
3652 4696
5532 16686
17732 19943
299 10938
5835 9787
5126 5403
1...

output:

1 0 1 1 0 1 0 1 0 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 1 0 0 0 1 0 1 0 1 1 1 1 0 0 0 1 1 0 0 0 1 1 0 1 1 1 1 1 0 1 0 0 1 0 1 1 0 1 1 0 1 1 0 1 1 0 0 0 0 0 1 0 0 0 1 1 0 0 1 1 0 0 0 1 0 1 1 0 0 0 0 1 0 1 0 0 0 1 0 0 1 0 1 0 1 1 1 1 0 1 0 1 1 1 0 1 0 1 1 0 0 1 1 1 1 1 0 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 29

result:

ok Number of moves = 29

Test #182:

score: 9
Accepted
time: 20ms
memory: 9760kb

input:

19997 19996 2 6 7111
9849 17565
2236 5372
26 12502
10735 16498
11580 17806
2077 12500
7026 14479
7467 10856
967 9542
4354 7980
3157 7788
2201 5155
3569 9170
3159 5623
3746 17563
15872 16662
18042 18801
6347 7315
13814 18605
6771 10011
3652 4696
5532 16686
17732 19943
299 10938
5835 9787
5126 5403
11...

output:

1 0 1 1 0 1 0 1 0 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 1 0 0 0 1 0 1 0 1 1 1 1 0 0 0 1 1 0 0 0 1 1 0 1 1 1 1 1 0 1 0 0 1 0 1 1 0 1 1 0 1 1 0 1 1 0 0 0 0 0 1 0 0 0 1 1 0 0 1 1 0 0 0 1 0 1 1 0 0 0 0 1 0 1 0 0 0 1 0 0 1 0 1 0 1 1 1 1 0 1 0 1 1 1 0 1 0 1 1 0 0 1 1 1 1 1 0 0 0 1 ...

input:

Interaction has been finished!

output:

Number of moves = 28

result:

ok Number of moves = 28

Test #183:

score: 9
Accepted
time: 10ms
memory: 9476kb

input:

19995 19994 2 6 3404
8865 9209
2968 17040
5854 8049
9791 17205
7167 12741
1614 10281
16461 19658
12322 18590
1598 11769
2528 7782
9785 15962
2374 7922
9082 18451
224 18990
4277 19857
7586 11411
6203 19140
2563 6849
11728 17324
5836 6436
9913 10126
6279 19352
9468 15927
1479 5668
11896 12781
1810 701...

output:

0 0 0 1 0 0 0 0 1 0 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 0 1 1 0 0 1 0 1 1 0 1 0 1 0 0 1 0 1 1 1 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 1 1 1 1 0 1 1 1 0 1 1 1 1 0 1 1 0 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 0 1 0 1 0 1 0 0 0 1 1 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0 1 0 1 1 1 0 1 1 1 0 1 1 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 15

result:

ok Number of moves = 15

Test #184:

score: 9
Accepted
time: 20ms
memory: 9464kb

input:

19995 19994 2 6 14055
8865 9209
2968 17040
5854 8049
9791 17205
7167 12741
1614 10281
16461 19658
12322 18590
1598 11769
2528 7782
9785 15962
2374 7922
9082 18451
224 18990
4277 19857
7586 11411
6203 19140
2563 6849
11728 17324
5836 6436
9913 10126
6279 19352
9468 15927
1479 5668
11896 12781
1810 70...

output:

0 0 0 1 0 0 0 0 1 0 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 0 1 1 0 0 1 0 1 1 0 1 0 1 0 0 1 0 1 1 1 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 1 1 1 1 0 1 1 1 0 1 1 1 1 0 1 1 0 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 0 1 0 1 0 1 0 0 0 1 1 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0 1 0 1 1 1 0 1 1 1 0 1 1 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 12

result:

ok Number of moves = 12

Test #185:

score: 9
Accepted
time: 14ms
memory: 9760kb

input:

19993 19992 2 6 17135
6807 11138
1797 14417
8947 13019
1173 2014
301 4061
11291 14649
1488 16624
10098 18172
9445 17869
12084 12375
6283 11709
2052 18561
1265 12166
8568 9232
3318 10081
1096 10662
1252 19130
2204 11684
7500 15084
4014 7294
8071 12249
6912 14461
5450 16614
2024 17852
11594 18355
1369...

output:

0 1 0 1 0 0 1 1 1 0 1 0 1 0 0 0 0 0 1 0 1 0 1 0 1 1 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 1 0 1 0 1 0 0 0 1 0 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 1 1 1 0 0 0 1 1 1 0 1 0 0 0 1 0 1 0 0 1 1 0 1 1 1 1 0 1 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 0 0 1 0 1 0 1 1 1 0 0 0 0 0 1 1 1 1 1 0 1 0 0 0 1 0 0 0 1 1 0 1 1 0 1 0 1 0 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 42

result:

ok Number of moves = 42

Test #186:

score: 9
Accepted
time: 20ms
memory: 9568kb

input:

19993 19992 2 6 16018
6807 11138
1797 14417
8947 13019
1173 2014
301 4061
11291 14649
1488 16624
10098 18172
9445 17869
12084 12375
6283 11709
2052 18561
1265 12166
8568 9232
3318 10081
1096 10662
1252 19130
2204 11684
7500 15084
4014 7294
8071 12249
6912 14461
5450 16614
2024 17852
11594 18355
1369...

output:

0 1 0 1 0 0 1 1 1 0 1 0 1 0 0 0 0 0 1 0 1 0 1 0 1 1 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 1 0 1 0 1 0 0 0 1 0 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 1 1 1 0 0 0 1 1 1 0 1 0 0 0 1 0 1 0 0 1 1 0 1 1 1 1 0 1 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 0 0 1 0 1 0 1 1 1 0 0 0 0 0 1 1 1 1 1 0 1 0 0 0 1 0 0 0 1 1 0 1 1 0 1 0 1 0 0 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 39

result:

ok Number of moves = 39

Test #187:

score: 9
Accepted
time: 14ms
memory: 9540kb

input:

19993 19992 2 6 6720
6766 13348
6533 9507
7105 9396
4320 18568
5471 10824
6924 11868
1499 3143
1121 15424
4755 9445
4994 16107
5875 6058
7731 11786
4727 13169
3084 8001
4791 7406
4290 16843
12689 17540
11512 19685
390 13872
9 5646
7865 13193
12581 15738
6152 9475
5396 19732
13577 19284
8287 19532
16...

output:

0 0 0 1 0 1 1 0 0 0 1 1 0 1 0 0 0 0 0 0 1 1 0 1 1 0 1 0 0 1 1 1 0 1 1 1 0 1 0 1 0 1 1 1 0 0 0 1 0 1 0 1 1 0 0 1 1 0 1 1 1 1 1 0 0 1 1 0 1 0 1 1 0 1 1 0 1 0 0 0 1 0 1 1 1 0 1 1 0 0 0 0 1 0 1 0 1 1 1 0 1 1 0 0 1 0 1 0 0 0 0 1 1 0 1 1 1 0 0 0 1 0 0 1 0 0 0 0 0 0 1 1 1 1 1 0 1 1 0 1 1 0 1 0 0 1 1 1 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 50

result:

ok Number of moves = 50

Test #188:

score: 9
Accepted
time: 14ms
memory: 9676kb

input:

19993 19992 2 6 18856
6766 13348
6533 9507
7105 9396
4320 18568
5471 10824
6924 11868
1499 3143
1121 15424
4755 9445
4994 16107
5875 6058
7731 11786
4727 13169
3084 8001
4791 7406
4290 16843
12689 17540
11512 19685
390 13872
9 5646
7865 13193
12581 15738
6152 9475
5396 19732
13577 19284
8287 19532
1...

output:

0 0 0 1 0 1 1 0 0 0 1 1 0 1 0 0 0 0 0 0 1 1 0 1 1 0 1 0 0 1 1 1 0 1 1 1 0 1 0 1 0 1 1 1 0 0 0 1 0 1 0 1 1 0 0 1 1 0 1 1 1 1 1 0 0 1 1 0 1 0 1 1 0 1 1 0 1 0 0 0 1 0 1 1 1 0 1 1 0 0 0 0 1 0 1 0 1 1 1 0 1 1 0 0 1 0 1 0 0 0 0 1 1 0 1 1 1 0 0 0 1 0 0 1 0 0 0 0 0 0 1 1 1 1 1 0 1 1 0 1 1 0 1 0 0 1 1 1 0 0 ...

input:

Interaction has been finished!

output:

Number of moves = 45

result:

ok Number of moves = 45

Extra Test:

score: 0
Extra Test Passed