#include<cstdio>
using namespace std;
int main()
{
	char st[5]="0000";
	char ans[5]="0000";
	int mx,u,v;
	for (int i=0;i<4;i++)
	{
		mx=0;
		for (int j=0;j<9;j++)
		{
			printf("%s",st);
			fflush(stdout);
			scanf("%d%d",&u,&v);
			if (u>mx)
				ans[i]=st[i],mx=u;
			st[i]++;
		}
	}
	printf("%s",ans);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
pair<int, int> guess(int x) {
  printf("%04d\n", x);
  fflush(stdout);
  int a, b;
  scanf("%d %d", &a, &b);
  return {a, b};
}
int main() {
  int maxa = 0, maxb = 0, maxc = 0, maxd = 0;
  int maxx = 0;
  for (int i = 0; i < 10; i++) {
    auto p = guess(i * 1000);
    if (p.first > maxx) {
      maxx = p.first;
      maxa = i;
    }
  }
  maxx = 0;
  for (int i = 0; i < 10; i++) {
    auto p = guess(i * 100);
    if (p.first > maxx) {
      maxx = p.first;
      maxb = i;
    }
  }
  maxx = 0;
  for (int i = 0; i < 10; i++) {
    auto p = guess(i * 10);
    if (p.first > maxx) {
      maxx = p.first;
      maxc = i;
    }
  }
  maxx = 0;
  for (int i = 0; i < 10; i++) {
    auto p = guess(i * 1);
    if (p.first > maxx) {
      maxx = p.first;
      maxd = i;
    }
  }
  maxx = 0;
  printf("%d\n", maxa * 1000 + maxb * 100 + maxc * 10 + maxd);
  fflush(stdout);
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
map<int, pair<int, int>> mp;
pair<int, int> guess(int x) {
  if (mp.find(x) != mp.end()) {
    return mp[x];
  }
  printf("%04d\n", x);
  fflush(stdout);
  int a, b;
  scanf("%d %d", &a, &b);
  if (a == 4) exit(0);
  return mp[x] = {a, b};
}
int main() {
  int maxa = 0, maxb = 0, maxc = 0, maxd = 0;
  int maxx = 0;
  for (int i = 0; i < 10; i++) {
    auto p = guess(i * 1000);
    if (p.first > maxx) {
      maxx = p.first;
      maxa = i;
    }
  }
  maxx = 0;
  for (int i = 0; i < 10; i++) {
    auto p = guess(i * 100);
    if (p.first > maxx) {
      maxx = p.first;
      maxb = i;
    }
  }
  maxx = 0;
  for (int i = 0; i < 10; i++) {
    auto p = guess(i * 10);
    if (p.first > maxx) {
      maxx = p.first;
      maxc = i;
    }
  }
  maxx = 0;
  for (int i = 0; i < 10; i++) {
    auto p = guess(i * 1);
    if (p.first > maxx) {
      maxx = p.first;
      maxd = i;
    }
  }
  maxx = 0;
  printf("%d\n", maxa * 1000 + maxb * 100 + maxc * 10 + maxd);
  fflush(stdout);
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
map<int, pair<int, int>> mp;
pair<int, int> guess(int x) {
  if (mp.find(x) != mp.end()) {
    return mp[x];
  }
  printf("%04d\n", x);
  fflush(stdout);
  int a, b;
  scanf("%d %d", &a, &b);
  if (a == 4) exit(0);
  return mp[x] = {a, b};
}
int main() {
  int maxa = 0, maxb = 0, maxc = 0, maxd = 0;
  int maxx = 0;
  for (int i = 0; i < 10; i++) {
    auto p = guess(i * 1000);
    if (p.first > maxx) {
      maxx = p.first;
      maxa = i;
    }
  }
  maxx = 0;
  for (int i = 0; i < 10; i++) {
    auto p = guess(i * 100);
    if (p.first > maxx) {
      maxx = p.first;
      maxb = i;
    }
  }
  maxx = 0;
  for (int i = 0; i < 10; i++) {
    auto p = guess(i * 10);
    if (p.first > maxx) {
      maxx = p.first;
      maxc = i;
    }
  }
  maxx = 0;
  for (int i = 0; i < 10; i++) {
    auto p = guess(i * 1);
    if (p.first > maxx) {
      maxx = p.first;
      maxd = i;
    }
  }
  maxx = 0;
  guess(maxa * 1000 + maxb * 100 + maxc * 10 + maxd);
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
map<int, pair<int, int>> mp;
pair<int, int> guess(int x) {
  if (mp.find(x) != mp.end()) {
    return mp[x];
  }
  printf("%04d\n", x);
  fflush(stdout);
  int a, b;
  scanf("%d %d", &a, &b);
  return mp[x] = {a, b};
}
int main() {
  int maxa = 0, maxb = 0, maxc = 0, maxd = 0;
  int maxx = 0;
  for (int i = 0; i < 10; i++) {
    auto p = guess(i * 1000);
    if (p.first > maxx) {
      maxx = p.first;
      maxa = i;
    }
  }
  maxx = 0;
  for (int i = 0; i < 10; i++) {
    auto p = guess(i * 100);
    if (p.first > maxx) {
      maxx = p.first;
      maxb = i;
    }
  }
  maxx = 0;
  for (int i = 0; i < 10; i++) {
    auto p = guess(i * 10);
    if (p.first > maxx) {
      maxx = p.first;
      maxc = i;
    }
  }
  maxx = 0;
  for (int i = 0; i < 10; i++) {
    auto p = guess(i * 1);
    if (p.first > maxx) {
      maxx = p.first;
      maxd = i;
    }
  }
  maxx = 0;
  printf("%d\n", maxa * 1000 + maxb * 100 + maxc * 10 + maxd);
  fflush(stdout);
  return 0;
}


#include <iostream>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include <string>
#include <bitset>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <sstream>
#include <stack>
#include <iomanip>
using namespace std;
#define pb push_back
#define mp make_pair
typedef pair<int,int> pii;
typedef long long ll;
typedef double ld;
typedef vector<int> vi;
#define fi first
#define se second
#define fe first
#define FO(x) {freopen(#x".in","r",stdin);freopen(#x".out","w",stdout);}
#define Edg int M=0,fst[SZ],vb[SZ],nxt[SZ];void ad_de(int a,int b){++M;nxt[M]=fst[a];fst[a]=M;vb[M]=b;}void adde(int a,int b){ad_de(a,b);ad_de(b,a);}
#define Edgc int M=0,fst[SZ],vb[SZ],nxt[SZ],vc[SZ];void ad_de(int a,int b,int c){++M;nxt[M]=fst[a];fst[a]=M;vb[M]=b;vc[M]=c;}void adde(int a,int b,int c){ad_de(a,b,c);ad_de(b,a,c);}
#define es(x,e) (int e=fst[x];e;e=nxt[e])
#define esb(x,e,b) (int e=fst[x],b=vb[e];e;e=nxt[e],b=vb[e])
#define VIZ {printf("digraph G{\n"); for(int i=1;i<=n;i++) for es(i,e) printf("%d->%d;\n",i,vb[e]); puts("}");}
#define VIZ2 {printf("graph G{\n"); for(int i=1;i<=n;i++) for es(i,e) if(vb[e]>=i)printf("%d--%d;\n",i,vb[e]); puts("}");}
#define SZ 666666
map<string,pii> rs;
pii reply(string s)
{
	if(rs.count(s)) return rs[s];
	cout<<s<<"\n";
	fflush(stdout);
	int a,b;
	cin>>a>>b;
	if(a==4&&b==0) exit(0);
	return rs[s]=pii(a,b);
}
int main()
{
	string r="0000";
	for(int p=0;p<4;p++)
	{
	pii rst; int bk;
	int rp[10];
	for(int i='0';i<='9';i++) rp[i-'0']=i;
	random_shuffle(rp,rp+10);
	for(int g=0;g<10;g++)
	{
		char i=rp[g];
		r[p]=i;
		pii cur=reply(r);
		if(!g) rst=cur, bk=i;
		else if(rst.fi!=cur.fi)
		{
			if(rst.fi>cur.fi)
				r[p]=bk;
			break;
		}
	}
	}
}


#include <iostream>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include <string>
#include <bitset>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <sstream>
#include <stack>
#include <iomanip>
using namespace std;
#define pb push_back
#define mp make_pair
typedef pair<int,int> pii;
typedef long long ll;
typedef double ld;
typedef vector<int> vi;
#define fi first
#define se second
#define fe first
#define FO(x) {freopen(#x".in","r",stdin);freopen(#x".out","w",stdout);}
#define Edg int M=0,fst[SZ],vb[SZ],nxt[SZ];void ad_de(int a,int b){++M;nxt[M]=fst[a];fst[a]=M;vb[M]=b;}void adde(int a,int b){ad_de(a,b);ad_de(b,a);}
#define Edgc int M=0,fst[SZ],vb[SZ],nxt[SZ],vc[SZ];void ad_de(int a,int b,int c){++M;nxt[M]=fst[a];fst[a]=M;vb[M]=b;vc[M]=c;}void adde(int a,int b,int c){ad_de(a,b,c);ad_de(b,a,c);}
#define es(x,e) (int e=fst[x];e;e=nxt[e])
#define esb(x,e,b) (int e=fst[x],b=vb[e];e;e=nxt[e],b=vb[e])
#define VIZ {printf("digraph G{\n"); for(int i=1;i<=n;i++) for es(i,e) printf("%d->%d;\n",i,vb[e]); puts("}");}
#define VIZ2 {printf("graph G{\n"); for(int i=1;i<=n;i++) for es(i,e) if(vb[e]>=i)printf("%d--%d;\n",i,vb[e]); puts("}");}
#define SZ 666666
template<class T1,class T2>
ostream& operator << (ostream& out,pair<T1,T2> p)
{out<<p.fi<<","<<p.se; return out;}
map<string,pii> rs;
pii reply(string s)
{
	if(rs.count(s)) return rs[s];
	cout<<s<<"\n";
	fflush(stdout);
	int a,b;
	cin>>a>>b;
	if(a==4&&b==0) exit(0);
	return rs[s]=pii(a,b);
}
pii gs(string a,string g)
{
	int a1=0,a2=0;
	bool cc[10]={};
	for(int i=0;i<4;i++)
	a1+=a[i]==g[i], cc[g[i]-'0']=1;
	for(int i=0;i<4;i++)
	{
		if(cc[a[i]-'0']&&a[i]!=g[i])
			++a2;
	}
	return pii(a1,a2);
}
vector<string> vec;
int main()
{
	//cout<<gs("0427","0724")<<"\n";
	//cout<<gs("0123","0330")<<"\n";
	srand(666623333);
	#define fora(x) for(char x='0';x<='9';x++)
	fora(a) fora(b) fora(c) fora(d)
	{
		if(a==b||a==c||a==d||b==c||b==d||c==d) continue;
		string s; s.pb(a); s.pb(b);
		s.pb(c); s.pb(d); vec.pb(s);
	}
	while(1)
	{
		string s=vec[rand()%vec.size()];
		pii rp=reply(s);
		vector<string> nx;
		for(int j=0;j<vec.size();j++)
		{
			if(gs(vec[j],s)!=rp) continue;
			nx.pb(vec[j]);
		}
		vec=nx;
	}
}


#include <iostream>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include <string>
#include <bitset>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <sstream>
#include <stack>
#include <iomanip>
using namespace std;
#define pb push_back
#define mp make_pair
typedef pair<int,int> pii;
typedef long long ll;
typedef double ld;
typedef vector<int> vi;
#define fi first
#define se second
#define fe first
#define FO(x) {freopen(#x".in","r",stdin);freopen(#x".out","w",stdout);}
#define Edg int M=0,fst[SZ],vb[SZ],nxt[SZ];void ad_de(int a,int b){++M;nxt[M]=fst[a];fst[a]=M;vb[M]=b;}void adde(int a,int b){ad_de(a,b);ad_de(b,a);}
#define Edgc int M=0,fst[SZ],vb[SZ],nxt[SZ],vc[SZ];void ad_de(int a,int b,int c){++M;nxt[M]=fst[a];fst[a]=M;vb[M]=b;vc[M]=c;}void adde(int a,int b,int c){ad_de(a,b,c);ad_de(b,a,c);}
#define es(x,e) (int e=fst[x];e;e=nxt[e])
#define esb(x,e,b) (int e=fst[x],b=vb[e];e;e=nxt[e],b=vb[e])
#define VIZ {printf("digraph G{\n"); for(int i=1;i<=n;i++) for es(i,e) printf("%d->%d;\n",i,vb[e]); puts("}");}
#define VIZ2 {printf("graph G{\n"); for(int i=1;i<=n;i++) for es(i,e) if(vb[e]>=i)printf("%d--%d;\n",i,vb[e]); puts("}");}
#define SZ 666666
map<string,pii> rs;
pii reply(string s)
{
	if(rs.count(s)) return rs[s];
	cout<<s<<"\n";
	fflush(stdout);
	int a,b;
	cin>>a>>b;
	if(a==4&&b==0) exit(0);
	return rs[s]=pii(a,b);
}
int main()
{
	string r="0000";
	for(int p=0;p<4;p++)
	{
	pii rst; int bk;
	int rp[10];
	for(int i='0';i<='9';i++) rp[i-'0']=i;
	random_shuffle(rp,rp+10);
	for(int g=0;g<10;g++)
	{
		char i=rp[g];
		r[p]=i;
		pii cur=reply(r);
		if(!g) rst=cur,bk=i;
		else if(rst!=cur)
		{
			if(rst.fi>cur.fi)
				r[p]=bk;
			break;
		}
	}
	}
}


#include <iostream>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include <string>
#include <bitset>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <sstream>
#include <stack>
#include <iomanip>
using namespace std;
#define pb push_back
#define mp make_pair
typedef pair<int,int> pii;
typedef long long ll;
typedef double ld;
typedef vector<int> vi;
#define fi first
#define se second
#define fe first
#define FO(x) {freopen(#x".in","r",stdin);freopen(#x".out","w",stdout);}
#define Edg int M=0,fst[SZ],vb[SZ],nxt[SZ];void ad_de(int a,int b){++M;nxt[M]=fst[a];fst[a]=M;vb[M]=b;}void adde(int a,int b){ad_de(a,b);ad_de(b,a);}
#define Edgc int M=0,fst[SZ],vb[SZ],nxt[SZ],vc[SZ];void ad_de(int a,int b,int c){++M;nxt[M]=fst[a];fst[a]=M;vb[M]=b;vc[M]=c;}void adde(int a,int b,int c){ad_de(a,b,c);ad_de(b,a,c);}
#define es(x,e) (int e=fst[x];e;e=nxt[e])
#define esb(x,e,b) (int e=fst[x],b=vb[e];e;e=nxt[e],b=vb[e])
#define VIZ {printf("digraph G{\n"); for(int i=1;i<=n;i++) for es(i,e) printf("%d->%d;\n",i,vb[e]); puts("}");}
#define VIZ2 {printf("graph G{\n"); for(int i=1;i<=n;i++) for es(i,e) if(vb[e]>=i)printf("%d--%d;\n",i,vb[e]); puts("}");}
#define SZ 666666
map<string,pii> rs;
pii reply(string s)
{
	if(rs.count(s)) return rs[s];
	cout<<s<<"\n";
	fflush(stdout);
	int a,b;
	cin>>a>>b;
	if(a==4&&b==0) exit(0);
	return rs[s]=pii(a,b);
}
pii gs(string a,string g)
{
	int a1=0,a2=0;
	bool cc[10]={};
	for(int i=0;i<4;i++)
	a1+=a[i]==g[i], cc[g[i]-'0']=1;
	for(int i=0;i<4;i++)
	{
		if(cc[a[i]-'0']&&a[i]!=g[i])
			++a2;
	}
	return pii(a1,a2);
}
vector<string> vec;
int main()
{
	srand(666623333);
	#define fora(x) for(char x='0';x<='9';x++)
	fora(a) fora(b) fora(c) fora(d)
	{
		string s; s.pb(a); s.pb(b);
		s.pb(c); s.pb(d); vec.pb(s);
	}
	while(vec.size()>1)
	{
		string s=vec[rand()%vec.size()];
		pii rp=reply(s);
		vector<string> nx;
		for(int j=0;j<vec.size();j++)
		{
			if(gs(vec[j],s)!=rp) continue;
			nx.pb(vec[j]);
		}
		vec=nx;
	}
}


#include <iostream>
#include <string>
#include <vector>
#include <tuple>
#include <cassert>

using std::cin;
using std::cout;
using std::endl;
using std::flush;
using std::string;
using std::to_string;
using std::vector;
using std::tuple;
using std::make_tuple;
using std::get;

//
// Returns a {bulls, cows} result from guessing n.
//
tuple<int, int> guess(const string& n) {
  int bulls, cows;
  cout << n << endl << flush;
  cin >> bulls >> cows;
  return make_tuple(bulls, cows);
}

//
// Returns the set of at most 4 unique digits that make up the number we are
// trying to determine in at most 10 calls to guess(...).
//
vector<int> get_digits() {
  vector<int> digits;

  for (int digit = 0; digit < 10; digit++) {
    string query(4, '0' + digit);
    auto result = guess(query);

    int bulls = get<0>(result);
    int cows = get<1>(result);

    if (bulls + cows > 0) {
      digits.push_back(digit);
    }
  }

  return digits;
}

vector<vector<int>> get_counts(int n) {
  assert(n > 0);
  assert(n < 5);

  switch (n) {
    case 1: return {{4}};
    case 2: return {{2, 2}, {1, 3}, {3, 1}};
    case 3: return {{1, 1, 2}, {1, 2, 1}, {2, 1, 1}};
    case 4: return {{1, 1, 1, 1}};
  }

  return {};
}

bool dfs(const vector<int>& digits, vector<int>& counts, string n) {  // NOLINT
  if (n.size() == 4) {
    auto result = guess(n);
    int bulls = get<0>(result);
    return bulls == 4;
  }

  for (size_t i = 0; i < digits.size(); i++) {
    if (counts[i] > 0) {
      counts[i]--;
      bool found = dfs(digits, counts,  n + to_string(digits[i]));
      counts[i]++;
      if (found) {
        return true;
      }
    }
  }

  return false;
}

int main() {
  auto digits = get_digits();

  for (auto counts : get_counts(digits.size())) {
    if (dfs(digits, counts, "")) {
      break;
    }
  }

  return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <tuple>
#include <cassert>

using std::cin;
using std::cout;
using std::endl;
using std::flush;
using std::string;
using std::to_string;
using std::vector;
using std::tuple;
using std::make_tuple;
using std::get;

//
// Returns a {bulls, cows} result from guessing n.
//
tuple<int, int> guess(const string& n) {
  int bulls, cows;
  cout << n << endl << flush;
  cin >> bulls >> cows;
  return make_tuple(bulls, cows);
}

//
// Returns the set of at most 4 unique digits that make up the number we are
// trying to determine in at most 10 calls to guess(...).
//
vector<int> get_digits() {
  vector<int> digits;

  for (int digit = 0; digit < 10; digit++) {
    string query(4, '0' + digit);
    auto result = guess(query);

    int bulls = get<0>(result);
    int cows = get<1>(result);

    if (bulls + cows > 0) {
      digits.push_back(digit);
    }
  }

  return digits;
}

//
// Returns all combinations of counts that n unique digits can have to form a
// 4 digit number.
//
vector<vector<int>> get_counts(int n) {
  assert(n > 0);
  assert(n < 5);

  switch (n) {
    case 1: return {{4}};
    case 2: return {{2, 2}, {1, 3}, {3, 1}};
    case 3: return {{1, 1, 2}, {1, 2, 1}, {2, 1, 1}};
    case 4: return {{1, 1, 1, 1}};
  }

  return {};
}

//
// Guesses all permutations of the given digits and their counts until a valid
// arrangement is found or all permutations are exhausted. If n is the number
// of unique digits, we guarantee that this will take no more than 40 guesses.
//
// Case n = 1 -> 4! = 24 permutations
//
// Case n = 2 -> (4 * 3) / 2 + 2 * 4 = 14 permutations
//
// Case n = 3 -> 3 * (4 * 3) = 36 permutations
//
// Case n = 4 -> 1 permutation
//
// These permutations are derived from the possible count distributions of n
// unique digits forming a 4 digit number defined in the get_counts(...)
// function above.
//
bool dfs(const vector<int>& digits, vector<int>& counts, string n) {  // NOLINT
  // Check if the 4 digit number we have built up is valid.
  if (n.size() == 4) {
    auto result = guess(n);
    int bulls = get<0>(result);
    return bulls == 4;
  }

  // Append every digit with count > 0 to the current string and DFS.
  for (size_t i = 0; i < digits.size(); i++) {
    if (counts[i] > 0) {
      counts[i]--;
      bool found = dfs(digits, counts,  n + to_string(digits[i]));
      counts[i]++;
      if (found) {
        return true;
      }
    }
  }

  return false;
}

int main() {
  auto digits = get_digits();

  for (auto counts : get_counts(digits.size())) {
    if (dfs(digits, counts, "")) {
      break;
    }
  }

  return 0;
}


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

#define fr(i,n)    for(int i=0;i<n;i++)
#define fru(i,a,b) for(int i=a;i<=b;i++)
#define frd(i,a,b) for(int i=a;i>=b;i--)

typedef long long   ll;
typedef long double ld;

const int INF = 2e9 + 10;
const int N   = 110;
const int MOD = 1e9 + 7;

int n, k;

int main() {
   //ios_base::sync_with_stdio(0);
   //cout.tie(0); cin.tie(0);

   string res = "xxxx";
   for(char c = '0'; c <= '9'; c++)
   {
      fru(i, 0, 3)
      {
         string s = "xxxx";
         s[i]     = c;

         cout << s << "\n";
         fflush(stdout);

         int b, k;
         cin >> b >> k;

         if(b == 1)
         {
            res[i] = c;
            break;
         }
         if(k == 0)
            break;
      }
   }

   cout << res << "\n";
   fflush(stdout);

   return 0;
}


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

#define fr(i,n)    for(int i=0;i<n;i++)
#define fru(i,a,b) for(int i=a;i<=b;i++)
#define frd(i,a,b) for(int i=a;i>=b;i--)

typedef long long   ll;
typedef long double ld;

const int INF = 2e9 + 10;
const int N   = 110;
const int MOD = 1e9 + 7;

int n, k;
int num[10];

int main() {
   //ios_base::sync_with_stdio(0);
   //cout.tie(0); cin.tie(0);

   string tmp = "0000";
   for(char c = '0'; c <= '9'; c++)
   {
      string str = "0000";
      str[0] = str[1] = str[2] = str[3] = c;

      cout << str << "\n";
      fflush(stdout);

      int b, k;
      cin >> b >> k;

      if(b > 0 || k > 0)
         num[c - '0'] = 1;
      else
         tmp[0] = tmp[1] = tmp[2] = tmp[3] = c;

   }

   string res = tmp;
   for(char c = '0'; c <= '9'; c++)
   {
      if(num[c - '0'] == 0)
         continue;

      fru(i, 0, 3)
      {
         string s = tmp;
         s[i]     = c;

         cout << s << "\n";
         fflush(stdout);

         int b, k;
         cin >> b >> k;

         if(b == 1)
         {
            res[i] = c;
            break;
         }
      }
   }

   cout << res << "\n";
   fflush(stdout);

   return 0;
}


#include<bits/stdc++.h>
#define int long long
#define ld long double
#define inf 0x7f7f7f7f7f7f7f7f
#define maxn 1010
#define ri register int
#define il inline
#define mk make_pair
#define pb push_back
#define fi first
#define se second
#define mod 998244353
#define db(x) cout << x << endl;
#define eps 0.0001
using namespace std;
signed main()
{
	ios::sync_with_stdio(0);
	int x,y;
	char p;
	for(int i=0;i<=9;i++)
	{
		for(int j=1;j<=4;j++)
			cout << i;
		cout << endl;
		cout << flush;
		cin >> x >> y;
		if(!x)
		{
			p=i+'0';
			break;
		}
	}
	char a[5] = {p,p,p,p,0};
	for(int i=0;i<4;i++)
		for(int j=0;j<=9;j++)
		{
			a[i] = j+'0';
			for(int k=0;k<4;k++)
				cout << a[k];
			cout << endl;
			cout << flush;
			cin >> x >>y;
			if(x==i+1)
				break;
		}
	return 0;
}


#include<bits/stdc++.h>
#define int long long
#define ld long double
#define inf 0x7f7f7f7f7f7f7f7f
#define maxn 1010
#define ri register int
#define il inline
#define mk make_pair
#define pb push_back
#define fi first
#define se second
#define mod 998244353
#define db(x) cout << x << endl;
#define eps 0.0001
using namespace std;
signed main()
{
	ios::sync_with_stdio(0);
	int p = 0,x,y;
	for(int i=0;i<=9;i++)
	{
		for(int j=1;j<=4;j++)
			cout << i;
		cout << flush;
		cin >> x >> y;
		if(x)
		{
			p=i;
			break;
		}
	}
	char a[5] = {y,y,y,y,0};
	for(int i=0;i<4;i++)
		for(int j=0;j<=9;j++)
		{
			a[i] = j+'0';
			cout << a << endl;
			cout << flush;
			cin >> x >>y;
			if(x==i+1)
				break;
		}
	return 0;
}


#include<bits/stdc++.h>
#define int long long
#define ld long double
#define inf 0x7f7f7f7f7f7f7f7f
#define maxn 1010
#define ri register int
#define il inline
#define mk make_pair
#define pb push_back
#define fi first
#define se second
#define mod 998244353
#define db(x) cout << x << endl;
#define eps 0.0001
using namespace std;
signed main()
{
	ios::sync_with_stdio(0);
	int x,y;
	char p;
	for(int i=0;i<=9;i++)
	{
		for(int j=1;j<=4;j++)
			cout << i;
		cout << flush;
		cin >> x >> y;
		if(x)
		{
			p=i+'0';
			break;
		}
	}
	char a[5] = {y,y,y,y,0};
	for(int i=0;i<4;i++)
		for(int j=0;j<=9;j++)
		{
			a[i] = j+'0';
			cout << a << endl;
			cout << flush;
			cin >> x >>y;
			if(x==i+1)
				break;
		}
	return 0;
}


#include<bits/stdc++.h>
#define int long long
#define ld long double
#define inf 0x7f7f7f7f7f7f7f7f
#define maxn 1010
#define ri register int
#define il inline
#define mk make_pair
#define pb push_back
#define fi first
#define se second
#define mod 998244353
#define db(x) cout << x << endl;
#define eps 0.0001
using namespace std;
signed main()
{
	ios::sync_with_stdio(0);
	int x,y;
	char p;
	for(int i=0;i<=9;i++)
	{
		for(int j=1;j<=4;j++)
			cout << i;
		cout << endl;
		cout << flush;
		cin >> x >> y;
		if(!x)
		{
			p=i+'0';
			break;
		}
	}
	char a[5] = {y,y,y,y,0};
	for(int i=0;i<4;i++)
		for(int j=0;j<=9;j++)
		{
			a[i] = j+'0';
			cout << a << endl;
			cout << flush;
			cin >> x >>y;
			if(x==i+1)
				break;
		}
	return 0;
}


#include<bits/stdc++.h>
#define int long long
#define ld long double
#define inf 0x7f7f7f7f7f7f7f7f
#define maxn 1010
#define ri register int
#define il inline
#define mk make_pair
#define pb push_back
#define fi first
#define se second
#define mod 998244353
#define db(x) cout << x << endl;
#define eps 0.0001
using namespace std;
signed main()
{
	ios::sync_with_stdio(0);
	int x,y;
	char p;
	for(int i=0;i<=9;i++)
	{
		for(int j=1;j<=4;j++)
			cout << i;
		cout << endl;
		cout << flush;
		cin >> x >> y;
		if(!x)
		{
			p=i+'0';
			break;
		}
	}
	char a[5] = {p,p,p,p,0};
	for(int i=0;i<4;i++)
		for(int j=0;j<=9;j++)
		{
			a[i] = j+'0';
			for(int k=0;k<5;k++)
				cout << a[k];
			cout << endl;
			cout << flush;
			cin >> x >>y;
			if(x==i+1)
				break;
		}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

int n,m;
int A[20],B[20],C1[20],C2[20],Ans[10];
int main(){
	for (int i=1;i<=4;i++){
		memset(A,0,sizeof(A));
		memset(B,0,sizeof(B));
		for (int j=0;j<=9;j++){
			for (int k=1;k<i;k++) printf("0");
			printf("%d",j);
			for (int k=i+1;k<=4;k++) printf("0");
			printf("\n");
			fflush(stdout);
			scanf("%d %d",&n,&m);
			A[n]++;B[m]++;
			C1[j]=n;C2[j]=m;
		}
		for (int j=0;j<=9;j++)
			if (A[C1[j]]==1) Ans[i]=j;
	}
	for (int i=1;i<=4;i++) printf("%d",Ans[i]);cout<<endl;
	fflush(stdout);
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

int n,m;
int A[20],B[20],C1[20],C2[20],Ans[10];
int main(){
	for (int i=1;i<=4;i++){
		memset(A,0,sizeof(A));
		memset(B,0,sizeof(B));
		for (int j=0;j<=9;j++){
			for (int k=1;k<i;k++) printf("0");
			printf("%d",j);
			for (int k=i+1;k<=4;k++) printf("0");
			fflush(stdout);
			scanf("%d %d",&n,&m);
			A[n]++;B[m]++;
			C1[j]=n;C2[j]=m;
		}
		for (int j=0;j<=9;j++)
			if (A[C1[j]]==1) Ans[i]=j;
	}
	for (int i=1;i<=4;i++) printf("%d",Ans[i]);cout<<endl;
	fflush(stdout);
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

int n,m;
int A[20],B[20],C1[20],C2[20],Ans[10];
int main(){
	for (int i=1;i<=4;i++){
		memset(A,0,sizeof(A));
		memset(B,0,sizeof(B));
		for (int j=0;j<=9;j++){
			printf("%d000\n",j);
			scanf("%d %d",&n,&m);
			fflush(stdout);
			A[n]++;B[m]++;
			C1[j]=n;C2[j]=m;
		}
		for (int j=0;j<=9;j++)
			if (A[C1[j]]==1) Ans[i]=j;
	}
	for (int i=1;i<=4;i++) printf("%d",Ans[i]);cout<<endl;
	fflush(stdout);
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

int n,m;
int A[20],B[20],C1[20],C2[20],Ans[10];
int main(){
	for (int i=1;i<=4;i++){
		memset(A,0,sizeof(A));
		memset(B,0,sizeof(B));
		for (int j=0;j<=9;j++){
			printf("%d000\n",j);
			fflush(stdout);
			scanf("%d %d",&n,&m);
			A[n]++;B[m]++;
			C1[j]=n;C2[j]=m;
		}
		for (int j=0;j<=9;j++)
			if (A[C1[j]]==1) Ans[i]=j;
	}
	for (int i=1;i<=4;i++) printf("%d",Ans[i]);cout<<endl;
	fflush(stdout);
	return 0;
}


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

int main() {
	vector<int> digits;
	int x, y;
	for (int i=0;i<10;i++) {
		cout << i << i << i << i;
		fflush(stdout);
		cin >> x >> y;
		if (x+y == 1)
			digits.push_back(i);
	}
	do {
		cout << digits[0] << digits[1] << digits[2] << digits[3];
		fflush(stdout);
		cin >> x >> y;
		if (x == 4 && y == 0)
			break;
	} while (next_permutation(digits.begin(),digits.end()));
}


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

int main() {
	vector<int> digits;
	int x, y;
	for (int i=0;i<10;i++) {
		cout << i << i << i << i << endl;
		// fflush(stdout);
		cin >> x >> y;
		if (x+y == 1)
			digits.push_back(i);
	}
	do {
		cout << digits[0] << digits[1] << digits[2] << digits[3] << endl;
		// fflush(stdout);
		cin >> x >> y;
		if (x == 4 && y == 0)
			break;
	} while (next_permutation(digits.begin(),digits.end()));
}


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

int main() {
	vector<int> digits;
	int x, y;
	for (int i=0;i<10;i++) {
		cout << i << i << i << i << endl;
		fflush(stdout);
		cin >> x >> y;
		if (x+y == 1)
			digits.push_back(i);
	}
	do {
		cout << digits[0] << digits[1] << digits[2] << digits[3] << endl;
		fflush(stdout);
		cin >> x >> y;
		if (x == 4 && y == 0)
			break;
	} while (next_permutation(digits.begin(),digits.end()));
}


#include<cstring>
#include<cstdio>
inline int G(){
	char tt=getchar();int o,f=0;
	while(tt<'0'||tt>'9'){if(tt=='-')f=1;tt=getchar();}
	for(o=0;tt>='0'&&tt<='9';tt=getchar())o=o*10+tt-'0';
	return f?-o:o;
}
int i,j,x;
int Q[4],F[10],C[10];
void Qry(){
	for(int i=0;i<4;i++)putchar(Q[i]+48);putchar('\n');
	fflush(stdin);
	scanf("%d%d",&x,&j);
}
int Sol(int t){
	memset(Q,0,sizeof(Q));
	memset(C,0,sizeof(C));
	for(int i=0;i<10;i++)
		Q[t]=i,Qry(),C[x]++;
	for(int i=0;i<10;i++)
		if(C[i]==1) return i;
}
int main(){
	for(i=0;i<4;i++) putchar(Sol(i)+48);
	return 0;
}


#include<cstring>
#include<cstdio>
inline int G(){
	char tt=getchar();int o,f=0;
	while(tt<'0'||tt>'9'){if(tt=='-')f=1;tt=getchar();}
	for(o=0;tt>='0'&&tt<='9';tt=getchar())o=o*10+tt-'0';
	return f?-o:o;
}
int i,j,x,o;
int Q[4],F[10],C[10],O[4];
void Qry(){
	for(int i=0;i<4;i++)putchar(Q[i]+48);putchar('\n');
	fflush(stdout);
	scanf("%d%d",&x,&j);
}
int Sol(int t){
	memset(Q,0,sizeof(Q));
	memset(C,0,sizeof(C));
	for(int i=0;i<10;i++)
		Q[t]=i,Qry(),C[x]++,F[i]=x;
	for(int i=0;i<10;i++)
		if(C[i]==1) o = i;
	for(int i=0;i<10;i++)
		if(F[i]==o) return i;
}
int main(){
	for(i=0;i<4;i++) O[i]=Sol(i);
	for(i=0;i<4;i++) putchar(O[i]+48);
	return 0;
}


#include<cstring>
#include<cstdio>
inline int G(){
	char tt=getchar();int o,f=0;
	while(tt<'0'||tt>'9'){if(tt=='-')f=1;tt=getchar();}
	for(o=0;tt>='0'&&tt<='9';tt=getchar())o=o*10+tt-'0';
	return f?-o:o;
}
int i,j,x;
int Q[4],F[10],C[10];
void Qry(){
	for(int i=0;i<4;i++)putchar(Q[i]+48);putchar('\n');
	fflush(stdout);
	scanf("%d%d",&x,&j);
}
int Sol(int t){
	memset(Q,0,sizeof(Q));
	memset(C,0,sizeof(C));
	for(int i=0;i<10;i++)
		Q[t]=i,Qry(),C[x]++;
	for(int i=0;i<10;i++)
		if(C[i]==1) return i;
}
int main(){
	for(i=0;i<4;i++) putchar(Sol(i)+48);
	return 0;
}


#include <bits/stdc++.h>
typedef int integer;
#define int long long
using namespace std;

integer main() {
	while (1){
		string t = "0000";
		string s = "0000";
		for (int i = 0; i < 4; i++){
			for (int j = 0; j < 10; j++){
				int a, b, c, d;
				s[i] = (char) ('0' + j);
				t[i] = (char) ('0' + ((j+1) % 10));
				cout << s << endl;
				cin >> a >> b;
				if (a == 4 && b == 0){
					return 0;
				}
				cout << t << endl;
				cin >> c >> d;
				if (c == 4 && d == 0){
					return 0;
				}
				if (a == c+1){
					t[i] = s[i];
					break;
				}
			}
		}
	}
}


#include <bits/stdc++.h>
typedef int integer;
#define int long long
using namespace std;

integer main() {
	while (1){
		string t = "0000";
		string s = "0000";
		for (int i = 0; i < 4; i++){
			for (int j = 0; j < 10; j++){
				int a, b, c, d;
				s[i] = (char) ('0' + j);
				t[i] = (char) ('0' + ((j+1) % 10));
				cout << s << endl;
				cin >> a >> b;
				if (a == 4 && b == 0){
					return 0;
				}
				cout << t << endl;
				cin >> c >> d;
				if (c == 4 && d == 0){
					return 0;
				}
				if (a == c+1){
					break;
				}
			}
		}
	}
}


#include <bits/stdc++.h>
#define sz(x) (int) (x).size()
typedef int integer;
#define int long long
using namespace std;

integer main() {
	while (1){
		string t = "0000";
		string s = "0000";
		vector<int> digits = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
		for (int i = 0; i < 4; i++){
			for (int j = 0; j < sz(digits); j+=2){
				int a, b, c, d;
				s[i] = (char) ('0' + digits[j]);
				t[i] = (char) ('0' + digits[((j+1) % sz(digits))]);
				cout << s << endl;
				cin >> a >> b;
				if (a == 4 && b == 0){
					return 0;
				}
				cout << t << endl;
				cin >> c >> d;
				if (c == 4 && d == 0){
					return 0;
				}
				if (a == c+1){
					t[i] = s[i];
					digits.erase(digits.begin(), digits.begin() + j);
					break;
				}
				else if (c == a+1){
					s[i] = t[i];
					digits.erase(digits.begin(), digits.begin() + j + 1);
					break;
				}
			}
		}
	}
}


#include <bits/stdc++.h>
typedef int integer;
#define int long long
using namespace std;

integer main() {
	while (1){
		string t = "0000";
		string s = "0000";
		set<int> digits = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
		for (int i = 0; i < 4; i++){
			int cnt = 1;
			for (auto j : digits){
				cnt++;
				if (cnt % 2) continue;

				int a, b, c, d;
				s[i] = (char) ('0' + j);
				t[i] = (char) ('0' + ((j+1) % 10));
				cout << s << endl;
				cin >> a >> b;
				if (a == 4 && b == 0){
					return 0;
				}
				cout << t << endl;
				cin >> c >> d;
				if (c == 4 && d == 0){
					return 0;
				}
				if (a == c+1){
					t[i] = s[i];
					digits.erase(s[i] - '0');
					break;
				}
				else if (c == a+1){
					s[i] = t[i];
					digits.erase(s[i] - '0');
					break;
				}
			}
		}
	}
}


#include <bits/stdc++.h>
typedef int integer;
#define int long long
using namespace std;

integer main() {
	while (1){
		string t = "0111";
		string s = "0000";
		for (int i = 0; i < 4; i++){
			for (int j = 0; j < 10; j++){
				int a, b, c, d;
				s[i] = t[i] = (char) ('0' + j);
				cout << s << endl;
				cin >> a >> b;
				if (a == 4 && b == 0){
					return 0;
				}
				cout << t << endl;
				cin >> c >> d;
				if (c == 4 && d == 0){
					return 0;
				}
				if (min(a, c) == i + 1){
					break;
				}
			}
		}
	}
}


#include <bits/stdc++.h>
typedef int integer;
#define int long long
using namespace std;

integer main() {
	while (1){
		string t = "0111";
		string s = "0000";
		for (int i = 0; i < 4; i++){
			for (int j = 0; j < 10; j++){
				int a, b, c, d;
				s[i] = t[i] = (char) ('0' + j);
				cout << s << endl;
				cin >> a >> b;
				if (a == 4 && b == 0){
					return 0;
				}
				cout << t << endl;
				cin >> c >> d;
				if (c == 4 && d == 0){
					return 0;
				}
				if (min(a, c) >= i + 1){
					break;
				}
			}
		}
	}
}


#include <bits/stdc++.h>
#define sz(x) (int) (x).size()
typedef int integer;
#define int long long
using namespace std;

integer main() {
	while (1){
		string t = "0000";
		string s = "0000";
		vector<int> digits = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
		for (int i = 0; i < 4; i++){
			for (int j = 0; j < sz(digits); j+=2){
				int a, b, c, d;
				s[i] = (char) ('0' + digits[j]);
				t[i] = (char) ('0' + digits[((j+1) % sz(digits))]);
				cout << s << endl;
				cin >> a >> b;
				if (a == 4 && b == 0){
					return 0;
				}
				cout << t << endl;
				cin >> c >> d;
				if (c == 4 && d == 0){
					return 0;
				}
				if (a == c+1){
					t[i] = s[i];
					digits.erase(digits.begin() + j);
					break;
				}
				else if (c == a+1){
					s[i] = t[i];
					digits.erase(digits.begin() + j + 1);
					break;
				}
			}
		}
	}
}


#include <bits/stdc++.h>
typedef int integer;
#define int long long
using namespace std;

integer main() {
	while (1){
		string t = "0000";
		string s = "0000";
		set<int> digits = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
		for (int i = 0; i < 4; i++){
			int cnt = 0;
			for (auto j : digits){
				if (cnt % 2) continue;
				cnt++;
				int a, b, c, d;
				s[i] = (char) ('0' + j);
				t[i] = (char) ('0' + ((j+1) % 10));
				cout << s << endl;
				cin >> a >> b;
				if (a == 4 && b == 0){
					return 0;
				}
				cout << t << endl;
				cin >> c >> d;
				if (c == 4 && d == 0){
					return 0;
				}
				if (a == c+1){
					t[i] = s[i];
					digits.erase(s[i] - '0');
					break;
				}
				else if (c == a+1){
					s[i] = t[i];
					digits.erase(s[i] - '0');
					break;
				}
			}
		}
	}
}


#include <cstdio>

char query[4] = { 'a','a','a','a' };

int main(void)
{
	int j = 0;
	int bulls = 0, cows = 0;
	while (bulls != 4)
	{
		for (int k = 0; k < 10; k++)
		{
			query[j] = char(k + 48);
			for (int i = 0; i < 4; i++)
				printf("%c", query[i]);
			fflush(stdout);
			scanf("%d%d", &bulls, &cows);
			fflush(stdin);
			if (j != bulls) { j = bulls; break; }
		}
	}

	return 0;
}


#include <iostream>

using namespace std;

char query[5] = { 'a','a','a','a' };

int test(void)
{
	char answer[5] = "5243";
	int bulls = 0;
	for (int i = 0; i < 4; i++)
	{
		if (query[i] == answer[i])
		{
			bulls++;
		}
	}
	return bulls;
}

int main(void)
{
	int j = 0;
	int bulls = 0, cows = 0;
	while (bulls != 4)
	{
		for (int k = 0; k < 10; k++)
		{
			query[j] = char(k + 48);
			//bulls = test();
			cout << query << endl;
			cin >> bulls >> cows;
			if (j != bulls) { j = bulls; break; }
		}
	}

	return 0;
}


#include <iostream>

using namespace std;

char query[5] = "aaaa";

int test(void)
{
	char answer[5] = "5243";
	int bulls = 0;
	for (int i = 0; i < 4; i++)
	{
		if (query[i] == answer[i])
		{
			bulls++;
		}
	}
	return bulls;
}

int main(void)
{
	int j = 0;
	int bulls = 0, cows = 0;
	while (bulls != 4)
	{
		for (int k = 0; k < 10; k++)
		{
			query[j] = char(k + 48);
			//bulls = test();
			cout << query << flush;
			cin >> bulls >> cows;
			if (j != bulls) { j = bulls; break; }
		}
	}

	return 0;
}


#include <iostream>

using namespace std;

int query[4];

int main(void)
{
	int j = 0,k;
	int bulls = 0, cows = 0;
	while (bulls!=4)
	{
		for (k=0;k<10;k++)
		{
			query[j] = k;
			for (int i = 0; i < 4; i++)
				cout << query[i] << flush;
			cin >> bulls >> cows;
			if (j != bulls) { j = bulls; break; }
		}
	}

	return 0;
}


#include <cstdio>

int query[4];

int main(void)
{
	int j = 0,k;
	int bulls = 0, cows = 0;
	while (bulls!=4)
	{
		for (k=0;k<10;k++)
		{
			query[j] = k;
			for (int i = 0; i < 4; i++)
				printf("%d",query[i]);
			fflush(stdout);
			scanf("%d%d", &bulls, &cows);
			if (j != bulls) { j = bulls; break; }
		}
	}

	return 0;
}


#include <iostream>

using namespace std;

char query[5];

int test(void)
{
	char answer[5] = "5243";
	int bulls = 0;
	for (int i = 0; i < 4; i++)
	{
		if (query[i] == answer[i])
		{
			bulls++;
		}
	}
	return bulls;
}

int main(void)
{
	int bulls = 0, cows = 0;

	for (int k = 0; k < 10; k++)
	{
		for (int i = 0; i < 4; i++) query[i] = k + '0';
		cout << query << endl;
		cin >> bulls >> cows;
		if (bulls == 0) { break; }
	}

	int j = 0;
	while (bulls != 4)
	{
		for (int k = 0; k < 10; k++)
		{
			query[j] = k + '0';
			//bulls = test();
			cout << query << endl;
			cin >> bulls >> cows;
			if (j != bulls) { j = bulls; break; }
		}
	}

	return 0;
}


#include <cstdio>

char query[4] = { 0 };

int main(void)
{
	int j = 0, k;
	int bulls = 0, cows = 0;
	while (bulls != 4)
	{
		for (k = 0; k < 10; k++)
		{
			query[j] = char(k + 48);
			for (int i = 0; i < 4; i++)
				printf("%c", query[i]);
			fflush(stdout);
			scanf("%d%d", &bulls, &cows);
			if (j != bulls) { j = bulls; break; }
		}
	}

	return 0;
}


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

#define ll long long
#define ii pair<int,int>

#define fi first
#define se second
#define mp make_pair
#define pb push_back

const int M = 2e5 + 10;
const int N = 2e5 + 10;
const int MOD = 1e9 + 7;
const int INF = 1e9;
int b, c;
bool d[10];
char s[4];
int main()
{
    for(int i = 0; i < 10; i++)
    {
        for(int j = 0; j < 4; j++)
            s[i]=i;
        puts(s);
        fflush(stdout);

        scanf("%d%d", &b, &c);

        if(b+c == 0)
            d[i] = 1;
     }
     int j = 0;
     for(int i = 0; i < 10; i++)
        if(!d[i])
            s[j++]=i;

    sort(s, s+4);
    while(1)
    {
        puts(s);
        fflush(stdout);
        next_permutation(s, s+4);
    }

}


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

#define ll long long
#define ii pair<int,int>

#define fi first
#define se second
#define mp make_pair
#define pb push_back

const int M = 2e5 + 10;
const int N = 2e5 + 10;
const int MOD = 1e9 + 7;
const int INF = 1e9;
int b, c;
bool d[10];
char s[5];
int main()
{
    for(int i = 0; i < 10; i++)
    {
        for(int j = 0; j < 4; j++)
            s[j]=i+'0';
        puts(s);
        fflush(stdout);

        scanf("%d%d", &b, &c);

        if(b+c == 0)
            d[i] = 1;
     }
     int j = 0;
     for(int i = 0; i < 10; i++)
        if(!d[i])
            s[j++]=i+'0';

    //puts(s);

    sort(s, s+4);
    while(1)
    {
        puts(s);
        fflush(stdout);
        next_permutation(s, s+4);
    }

}


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

#define ll long long
#define ii pair<int,int>

#define fi first
#define se second
#define mp make_pair
#define pb push_back

const int M = 2e5 + 10;
const int N = 2e5 + 10;
const int MOD = 1e9 + 7;
const int INF = 1e9;
int b, c;
bool d[10];
char s[5];
int main()
{
    for(int i = 0; i < 10; i++)
    {
        for(int j = 0; j < 4; j++)
            s[j]=i+'0';
        puts(s);
        fflush(stdout);

        scanf("%d%d", &b, &c);

        if(b+c == 0)
            d[i] = 1;
     }
     int j = 0;
     for(int i = 0; i < 10; i++)
        if(!d[i])
            s[j++]=i+'0';

    //puts(s);

    sort(s, s+4);
    while(1)
    {
        puts(s);
        fflush(stdout);
        scanf("%d%d", &b, &c);
        if(b == 4)
            return 0;
        next_permutation(s, s+4);
    }

}


#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<queue>
#include<cmath>
#include<stack>
#include<climits>
#include<map>
#include<set>
#include<utility>
#include<iterator>
#include<cstring>
#include<cstdio>
#include<unordered_map>
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define umap unordered_map
#define ff first
#define ss second
//#define scd static_cast<double>
using namespace std;
using ll=long long;
using ull=unsigned long long;
using pii=pair<int, int>;
using pll=pair<ll,ll>;
using vi=vector<int>;
using vll=vector<ll>;
using pill=pair<int,ll>;
using vvi=vector<vi>;

ll gcd(ll a, ll b)
{
	ll t;
	while((t=a%b)!=0) {
		a=b;
		b=t;
	}
	return b;
}

ll fast_exp(ll base, ll n, ll m)
{
	if(n==0)	return 1;
	ll t=fast_exp(base,n/2,m);
	if(n%2==0)	return (t*t)%m;
	else	return (((t*t)%m)*base)%m;
}

bool is_set(int i, ll mask)
{
	return (mask>>i)&1;
}

int count_bits(ll mask)
{
	int ans=0;
	for(int i=0;i<64;++i)
		if (is_set(i,mask)) ++ans;
	return ans;
}

int first_bit(ll mask)
{
	int i=0;
	while(i<64)
		if(is_set(i++, mask)) return i-1;
	return -1;
}

void next(string& s)
{
	int i=3;
	while(i>0 && s[i-1]>s[i]) --i;
	if (!i) return;
	int j=i-1;
	char t=s[j];
	int k=3;
	while (s[k]<t) --k;
	s[j]=s[k];
	s[k]=t;
	sort(s.begin()+i,s.end());
}

int main()
{
	ios::sync_with_stdio(false);
	vector<char> dig;
	for (int i=0; i<10;++i) {
		cout << string(4,'0'+i);
		fflush(stdout);
		int b, c;cin>>b>>c;
		if (b+c>=1) dig.pb('0'+i);
	}
	string num(dig.begin(), dig.end());
	for (int i=1;i<=24;++i) {
		cout << num;
		fflush(stdout);
		int b,c;cin>>b>>c;
		if (b==4) return 0;
		next(num);
	}
	return 0;
}


#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<queue>
#include<cmath>
#include<stack>
#include<climits>
#include<map>
#include<set>
#include<utility>
#include<iterator>
#include<cstring>
#include<cstdio>
#include<unordered_map>
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define umap unordered_map
#define ff first
#define ss second
//#define scd static_cast<double>
using namespace std;
using ll=long long;
using ull=unsigned long long;
using pii=pair<int, int>;
using pll=pair<ll,ll>;
using vi=vector<int>;
using vll=vector<ll>;
using pill=pair<int,ll>;
using vvi=vector<vi>;

ll gcd(ll a, ll b)
{
	ll t;
	while((t=a%b)!=0) {
		a=b;
		b=t;
	}
	return b;
}

ll fast_exp(ll base, ll n, ll m)
{
	if(n==0)	return 1;
	ll t=fast_exp(base,n/2,m);
	if(n%2==0)	return (t*t)%m;
	else	return (((t*t)%m)*base)%m;
}

bool is_set(int i, ll mask)
{
	return (mask>>i)&1;
}

int count_bits(ll mask)
{
	int ans=0;
	for(int i=0;i<64;++i)
		if (is_set(i,mask)) ++ans;
	return ans;
}

int first_bit(ll mask)
{
	int i=0;
	while(i<64)
		if(is_set(i++, mask)) return i-1;
	return -1;
}

void next(string& s)
{
	int i=3;
	while(i>0 && s[i-1]>s[i]) --i;
	if (!i) return;
	int j=i-1;
	char t=s[j];
	int k=3;
	while (s[k]<t) --k;
	s[j]=s[k];
	s[k]=t;
	sort(s.begin()+i,s.end());
}

int main()
{
	ios::sync_with_stdio(false);
	vector<char> dig;
	for (int i=0; i<10;++i) {
		cout << string(4,'0'+i) << endl;
		fflush(stdout);
		int b, c;cin>>b>>c;
		if (b+c>=1) dig.pb('0'+i);
	}
	string num(dig.begin(), dig.end());
	for (int i=1;i<=24;++i) {
		cout << num << endl;
		fflush(stdout);
		int b,c;cin>>b>>c;
		if (b==4) return 0;
		next(num);
	}
	return 0;
}


/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
   ll t;
   cin>>t;
   while(t--)
   {
       ll a,b,c;
       cin>>a>>b>>c;
       cout<<a+b<<endl;
   }

    return 0;
}


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

int main()
{
    int t; cin>>t;
    while(t--)
    {
        long long int n=3;
        long long int a[n];
        for(int i=0; i<3; i++)
        cin>>a[i];

        sort(a,a+n);

        long long int k=a[2]+a[0]+a[1]-1;
        cout<<k<<endl;
    }
}


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

int main()
{
    int t; cin>>t;
    while(t--)
    {
        int a,b,c; cin>>a>>b>>c;
        int ma=max(a,max(b,c));
        int ans=a+b+c-1;
        cout<<endl;
    }
}


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

int main()
{
    int t; cin>>t;
    while(t--)
    {
        int a,b,c; cin>>a>>b>>c;
        int ma=max(a,max(b,c));
        int ans=a+b+c-ma;
        cout<<endl;
    }
}


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

int main()
{
    int t; cin>>t;
    while(t--)
    {
        int n=3;
        int a[n];
        for(int i=0; i<3; i++)
        cin>>a[i];

        sort(a,a+n);
        cout<<a[1]<<endl;
    }
}


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

int main()
{
    int t; cin>>t;
    while(t--)
    {
        int n=3;
        int a[n];
        for(int i=0; i<3; i++)
        cin>>a[i];

        cout<<a[2]+1-a[0]-a[1]<<endl;
    }
}


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

int main()
{
    int t; cin>>t;
    while(t--)
    {
        int n=3;
        int a[n];
        for(int i=0; i<3; i++)
        cin>>a[i];

        cout<<a[2]-1<<endl;
    }
}


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

int main()
{
    int t; cin>>t;
    while(t--)
    {
        int a,b,c; cin>>a>>b>>c;
        cout<<a+b+1<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main(){

#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	ll t;
	cin>>t;
	while(t--){
		ll a,b,c;
		cin>>a>>b>>c;

		ll one = max(max(a,b),c );
		ll two=one;
		if(a<one and (a>b or a>c) ){
			two = a;
		}
		else if(b<one and (b>a or b>c) ){
			two = b;
		}
		else if(c<one and (c>b or c>a) ){
			two = c;
		}

		ll three = min(min(a,b),c);
		ll y = (one - two);
		ll a1 = y*y + three*three;

		ll q = (one - three);
		ll a2 = q*q +two*two;

		ll p = (two-three);
		ll a3 = p*p +one*one;
		ll yy = a1;

		a1 = max(max(a1,a2),a3);

		a2 = min(min(yy,a2),a3);

		cout<< round( ( round(pow(a1,0.5))   + round(pow(a2,0.5) ) )/2 ) <<endl ;

	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main(){

#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	ll t;
	cin>>t;
	while(t--){
		ll a,b,c;
		cin>>a>>b>>c;

		cout<< (a+b+c)-1  <<endl ;

	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main(){

#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	ll t;
	cin>>t;
	while(t--){
		ll a,b,c;
		cin>>a>>b>>c;
		ll t = abs(a-b);
		float ans = t*t + c*c;
		cout<< round(pow(ans,0.5))<<endl ;

	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main(){

#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	ll t;
	cin>>t;
	while(t--){
		ll a,b,c;
		cin>>a>>b>>c;

		ll one = max(max(a,b),c );
		ll two=one;
		if(a<one and (a>b or a>c) ){
			two = a;
		}
		else if(b<one and (b>a or b>c) ){
			two = b;
		}
		else if(c<one and (c>b or c>a) ){
			two = c;
		}

		ll three = min(min(a,b),c);
		ll y = (one - two);
		ll a1 = y*y + three*three;

		ll q = (one - three);
		ll a2 = q*q +two*two;

		ll p = (two-three);
		ll a3 = p*p +one*one;
		ll yy = a1;

		// a1 = max(max(a1,a2),a3);

		a2 = min(min(yy,a2),a3);

		cout<< round(  sqrt(a2) )  <<endl ;

	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int

float squareRoot(int number, int precision)
{
    int start = 0, end = number;
    int mid;

    // variable to store the answer
    float ans;

    // for computing integral part
    // of square root of number
    while (start <= end) {
        mid = (start + end) / 2;
        if (mid * mid == number) {
            ans = mid;
            break;
        }

        // incrementing start if integral
        // part lies on right side of the mid
        if (mid * mid < number) {
            start = mid + 1;
            ans = mid;
        }

        // decrementing end if integral part
        // lies on the left side of the mid
        else {
            end = mid - 1;
        }
    }

    // For computing the fractional part
    // of square root upto given precision
    float increment = 0.1;
    for (int i = 0; i < precision; i++) {
        while (ans * ans <= number) {
            ans += increment;
        }

        // loop terminates when ans * ans > number
        ans = ans - increment;
        increment = increment / 10;
    }
    return ans;
}

int main(){

#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	ll t;
	cin>>t;
	while(t--){
		ll a,b,c;
		cin>>a>>b>>c;

		ll one = max(max(a,b),c );
		ll two=one;
		if(a<one and (a>b or a>c) ){
			two = a;
		}
		else if(b<one and (b>a or b>c) ){
			two = b;
		}
		else if(c<one and (c>b or c>a) ){
			two = c;
		}

		ll three = min(min(a,b),c);
		ll y = (one - two);
		ll a1 = y*y + three*three;

		ll q = (one - three);
		ll a2 = q*q +two*two;

		ll p = (two-three);
		ll a3 = p*p +one*one;
		ll yy = a1;

		a1 = max(max(a1,a2),a3);

		a2 = min(min(yy,a2),a3);

		cout<< ceil( ( ceil(  squareRoot(a1,2) )   + ceil(  squareRoot(a2,2) ) )/2 ) <<endl ;

	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main(){

#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	ll t;
	cin>>t;
	while(t--){
		ll a,b,c;
		cin>>a>>b>>c;

		ll one = max(max(a,b),c );
		ll two=one;
		if(a<one and (a>b or a>c) ){
			two = a;
		}
		else if(b<one and (b>a or b>c) ){
			two = b;
		}
		else if(c<one and (c>b or c>a) ){
			two = c;
		}

		ll three = min(min(a,b),c);
		ll y = (one - two);
		long double a1 = y*y + three*three;

		ll q = (one - three);
		long double a2 = q*q +two*two;

		cout<< ceil( (pow(a1,0.5)+pow(a2,0.5) )/2 ) <<endl ;

	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main(){

#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	ll t;
	cin>>t;
	while(t--){
		ll a,b,c;
		cin>>a>>b>>c;

		ll one = max(max(a,b),c );
		ll two=one;
		if(a<one and (a>b or a>c) ){
			two = a;
		}
		else if(b<one and (b>a or b>c) ){
			two = b;
		}
		else if(c<one and (c>b or c>a) ){
			two = c;
		}

		ll three = min(min(a,b),c);
		// ll y = (one - two);
		// ll a1 = y*y + three*three;

		// ll q = (one - three);
		// ll a2 = q*q +two*two;

		// ll p = (two-three);
		// ll a3 = p*p +one*one;
		// ll yy = a1;
		cout<<abs(three-one)<<endl;

		// a1 = max(max(a1,a2),a3);

		// a2 = min(min(yy,a2),a3);

		// cout<< ceil( ( ceil(pow(a1,0.5))   + ceil(pow(a2,0.5) ) )/2 ) <<endl ;

	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main(){

#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	ll t;
	cin>>t;
	while(t--){
		ll a,b,c;
		cin>>a>>b>>c;

		ll one = max(max(a,b),c );
		ll two=one;
		if(a<one and (a>b or a>c) ){
			two = a;
		}
		else if(b<one and (b>a or b>c) ){
			two = b;
		}
		else if(c<one and (c>b or c>a) ){
			two = c;
		}

		ll three = min(min(a,b),c);
		ll y = (one - two);
		ll a1 = y*y + three*three;

		ll q = (one - three);
		ll a2 = q*q +two*two;

		ll p = (two-three);
		ll a3 = p*p +one*one;
		ll yy = a1;

		// a1 = max(max(a1,a2),a3);

		a2 = min(min(yy,a2),a3);

		cout<< ceil(  sqrt(a2) )  <<endl ;

	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main(){

#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	ll t;
	cin>>t;
	while(t--){
		ll a,b,c;
		cin>>a>>b>>c;

		// ll one = max(max(a,b),c );
		// ll two=one;
		// if(a<one and (a>b or a>c) ){
		// 	two = a;
		// }
		// else if(b<one and (b>a or b>c) ){
		// 	two = b;
		// }
		// else if(c<one and (c>b or c>a) ){
		// 	two = c;
		// }

		// ll three = min(min(a,b),c);
		// ll y = (one - two);
		// ll a1 = y*y + three*three;

		// ll q = (one - three);
		// ll a2 = q*q +two*two;

		// ll p = (two-three);
		// ll a3 = p*p +one*one;
		// ll yy = a1;
		cout<<ceil((a+b+c)/2)<<endl;

		// a1 = max(max(a1,a2),a3);

		// a2 = min(min(yy,a2),a3);

		// cout<< ceil( ( ceil(pow(a1,0.5))   + ceil(pow(a2,0.5) ) )/2 ) <<endl ;

	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main(){

#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	ll t;
	cin>>t;
	while(t--){
		ll a,b,c;
		cin>>a>>b>>c;

		ll one = max(max(a,b),c );
		ll two=one;
		if(a<one and (a>b or a>c) ){
			two = a;
		}
		else if(b<one and (b>a or b>c) ){
			two = b;
		}
		else if(c<one and (c>b or c>a) ){
			two = c;
		}

		ll three = min(min(a,b),c);
		ll y = (one - two);
		ll a1 = y*y + three*three;

		ll q = (one - three);
		ll a2 = q*q +two*two;

		ll p = (two-three);
		ll a3 = p*p +one*one;
		ll yy = a1;

		// a1 = max(max(a1,a2),a3);

		a2 = min(min(yy,a2),a3);

		cout<<round(  sqrt(a2) ) + 1 <<endl ;

	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main(){

#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	ll t;
	cin>>t;
	while(t--){
		ll a,b,c;
		cin>>a>>b>>c;

		cout<< round((a+b+c+1)/2)  <<endl ;

	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main(){

#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	ll t;
	cin>>t;
	while(t--){
		ll a,b,c;
		cin>>a>>b>>c;

		ll one = max(max(a,b),c );
		ll two=one;
		if(a<one and (a>b or a>c) ){
			two = a;
		}
		else if(b<one and (b>a or b>c) ){
			two = b;
		}
		else if(c<one and (c>b or c>a) ){
			two = c;
		}

		ll three = min(min(a,b),c);
		ll y = (one - two);
		ll a1 = y*y + three*three;

		ll q = (one - three);
		ll a2 = q*q +two*two;

		ll p = (two-three);
		ll a3 = p*p +one*one;
		ll yy = a1;

		a1 = max(max(a1,a2),a3);

		a2 = min(min(yy,a2),a3);

		cout<< floor( ( floor(  sqrt(a1) )   + floor(  sqrt(a2) ) )/2 ) <<endl ;

	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main(){

#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	ll t;
	cin>>t;
	while(t--){
		ll a,b,c;
		cin>>a>>b>>c;

		int one = max(max(a,b),c );
		int two=one;
		if(a<one and (a>b or a>c) ){
			two = a;
		}
		else if(b<one and (b>a or b>c) ){
			two = b;
		}
		else if(c<one and (c>b or c>a) ){
			two = c;
		}

		int three = min(min(a,b),c);
		int y = (one - two);
		int a1 = y*y + three*three;

		int q = (one - three);
		int a2 = q*q +two*two;

		cout<< round((ceil(pow(a1,0.5))+ceil(pow(a2,0.5)))/2) <<endl ;

	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main(){

#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	ll t;
	cin>>t;
	while(t--){
		ll a,b,c;
		cin>>a>>b>>c;

		ll one = max(max(a,b),c );
		ll two=one;
		if(a<one and (a>b or a>c) ){
			two = a;
		}
		else if(b<one and (b>a or b>c) ){
			two = b;
		}
		else if(c<one and (c>b or c>a) ){
			two = c;
		}

		cout<< two <<endl ;

	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int

ll floorSqrt(ll x)
{
    // Base cases
    if (x == 0 || x == 1)
       return x;

    // Do Binary Search for floor(sqrt(x))
    ll start = 1, end = x, ans;
    while (start <= end)
    {
        ll mid = (start + end) / 2;

        // If x is a perfect square
        if (mid*mid == x)
            return mid;

        // Since we need floor, we update answer when mid*mid is
        // smaller than x, and move closer to sqrt(x)
        if (mid*mid < x)
        {
            start = mid + 1;
            ans = mid;
        }
        else // If mid*mid is greater than x
            end = mid-1;
    }
    return ans;
}

int main(){

#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	ll t;
	cin>>t;
	while(t--){
		ll a,b,c;
		cin>>a>>b>>c;

		ll one = max(max(a,b),c );
		ll two=one;
		if(a<one and (a>b or a>c) ){
			two = a;
		}
		else if(b<one and (b>a or b>c) ){
			two = b;
		}
		else if(c<one and (c>b or c>a) ){
			two = c;
		}

		ll three = min(min(a,b),c);
		ll y = (one - two);
		ll a1 = y*y + three*three;

		ll q = (one - three);
		ll a2 = q*q +two*two;

		ll p = (two-three);
		ll a3 = p*p +one*one;
		ll yy = a1;

		a1 = max(max(a1,a2),a3);

		a2 = min(min(yy,a2),a3);

		cout<< ceil( ( ceil(  floorSqrt(a1) )   + ceil(  floorSqrt(a2) ) )/2 ) <<endl ;

	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main(){

#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	int t;
	cin>>t;
	while(t--){
		int a,b,c;
		cin>>a>>b>>c;
		int t = abs(a-b);
		int ans = t*t + c*c;
		cout<< ceil(pow(ans,0.5))<<endl ;

	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main(){

#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	int t;
	cin>>t;
	while(t--){
		int a,b,c;
		cin>>a>>b>>c;
		int t = abs(a-b);
		float ans = t*t + c*c;
		cout<< round(pow(ans,0.5))<<endl ;

	}

	return 0;
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;

int main() {
		int test;
		cin>>test;
		while(test--)
		{
			ll a,b,c;
			cin>>a>>b>>c;

			cout<<a+b-1<<endl;
		}
	return 0;
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;

int main() {
		int test;
		cin>>test;
		while(test--)
		{
			ll a,b,c;
			cin>>a>>b>>c;

			cout<<b+c<<endl;
		}
	return 0;
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;

int main() {
		int test;
		cin>>test;
		while(test--)
		{
			ll a,b,c;
			cin>>a>>b>>c;

			cout<<a+b+c-min(a,min(b,c))-1<<endl;
		}
	return 0;
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;

int main() {
		int test;
		cin>>test;
		while(test--)
		{
			ll a,b,c;
			cin>>a>>b>>c;

			cout<<a+c<<endl;
		}
	return 0;
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;

int main() {
		int test;
		cin>>test;
		while(test--)
		{
			ll a,b,c;
			cin>>a>>b>>c;

			cout<<a+b+c<<endl;
		}
	return 0;
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;

int main() {
		int test;
		cin>>test;
		while(test--)
		{
			ll a,b,c;
			cin>>a>>b>>c;

			cout<<a+b+c-max(a,max(b,c))<<endl;
		}
	return 0;
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;

int main() {
		int test;
		cin>>test;
		while(test--)
		{
			ll a,b,c;
			cin>>a>>b>>c;
			int arr[3];
			arr[0]=a,arr[1]=b,arr[3]=c;
			sort(arr,arr+3);
			cout<<a+b+c-arr[1]<<endl;
		}
	return 0;
}


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

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin>>t;
    while(t--){
        vector<long long>v(4);
        for(int i=0;i<3;i++){
            cin>>v[i];
        }
        sort(v.begin(),v.end());
        long long mini=v[2]-v[0],side=v[1];
        cout<< floor(sqrt((mini * mini) + (side * side)))<<"\n";

    }
    return 0;
}


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

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin>>t;
    while(t--){
        vector<long long>v(4);
        for(int i=0;i<3;i++){
            cin>>v[i];
        }
        sort(v.begin(),v.end());
        long long mini=v[2]-v[0],side=v[1];
        cout<< ceil(sqrt((mini * mini) + (side * side)))<<"\n";

    }
    return 0;
}


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

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin>>t;
    while(t--){
        long long a,b,c,d,maxi=0,mini=INT_MAX;
        cin>>a>>b>>c;
        maxi=max(a,b);
        mini=min(a,b);
        mini=min(mini,c);
        maxi=max(maxi,c);
        cout<<maxi-mini<<"\n";
    }
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;

void solve(){
	int a,b,c;
	cin>>a>>b>>c;
	cout<<a+b+c-1<<'\n';
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t=1;
	cin>>t;
	while(t--){
		solve();
	}
	return 0;
}


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

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin>>t;
    while(t--){

        long long a,b,c;
        cin>>a>>b>>c>>d;
        cout<<"2"<<"\n";
        // vector<long long>v(4);
        // for(int i=0;i<3;i++){
        //     cin>>v[i];
        // }
        // sort(v.begin(),v.end());
        // long long mini=v[2]-v[0],side=v[1];
        // cout<< ceil(sqrt((mini * mini) + (side * side)))<<"\n";

    }
    return 0;
}


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

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin>>t;
    while(t--){

        long long a,b,c;
        cin>>a>>b>>c;
        cout<<"2"<<"\n";
        // vector<long long>v(4);
        // for(int i=0;i<3;i++){
        //     cin>>v[i];
        // }
        // sort(v.begin(),v.end());
        // long long mini=v[2]-v[0],side=v[1];
        // cout<< ceil(sqrt((mini * mini) + (side * side)))<<"\n";

    }
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;

void solve(){
	ll a,b,c;
	cin>>a>>b>>c;

	cout<<max(a,max(b,c))<<'\n';
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t=1;
	cin>>t;
	while(t--){
		solve();
	}
	return 0;
}


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

int main()
{
    int t,a,b,c;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d %d %d",&a,&b,&c);
        printf("%d\n",a+b+c);
    }
}


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

int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int ar[3];
        scanf("%d %d %d",&ar[0],&ar[1],&ar[2]);
        sort(&ar[0],&ar[3]);
        printf("%d\n",ar[0]+ar[1]);
    }
}


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

int main()
{
    int t,a,b,c;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d %d %d",&a,&b,&c);
        printf("%d\n",a+b+1);
    }
}


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

int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int ar[3];
        scanf("%d %d %d",&ar[0],&ar[1],&ar[2]);
        sort(&ar[0],&ar[3]);
        printf("%d\n",ar[2]);
    }
}


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

int main()
{
    int t,a,b,c;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d %d %d",&a,&b,&c);
        printf("1\n");
    }
}


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

int main()
{
    int t,a,b,c;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d %d %d",&a,&b,&c);
        printf("%d\n",c);
    }
}


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

int main()
{
    int t,a,b,c;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d %d %d",&a,&b,&c);
        a=min(a,b),b=min(a,c);
        printf("%d\n",a+b+1);
    }
}


#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define loop(i,n) for(int i = 0; i < n; i++)
#define mp make_pair
#define F first
#define S second
#define asort(a) sort(a,a+n)
#define vsort(v) sort(v.begin(), v.end())
#define remdup(v) v.erase(unique(v.begin(), v.end()), v.end())
#define iter(m) for(auto it = m.begin(); it != m.end(); it++)
#define mceil(a,b) (a+b-1)/b;
#define flag 0

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<long, long> pll;

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
	int t;
	cin >> t;
	while(t--){
	    ll a, b, c;
	    cin >> a >> b >> c;
	    ull p = a, q = b > c ? b-c:c-b;
	    double = (double)sqrt(pow(p,2)+pow(q,2));
	    //cout << res << endl;
	    cout << ceil(res) << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define loop(i,n) for(int i = 0; i < n; i++)
#define mp make_pair
#define F first
#define S second
#define asort(a) sort(a,a+n)
#define vsort(v) sort(v.begin(), v.end())
#define remdup(v) v.erase(unique(v.begin(), v.end()), v.end())
#define iter(m) for(auto it = m.begin(); it != m.end(); it++)
#define mceil(a,b) (a+b-1)/b;
#define flag 0

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<long, long> pll;

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
	int t;
	cin >> t;
	while(t--){
	    ll a[3];
	    loop(i, 3) cin >> a[i];
	    cout<< a[1] << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define loop(i,n) for(int i = 0; i < n; i++)
#define mp make_pair
#define F first
#define S second
#define asort(a) sort(a,a+n)
#define vsort(v) sort(v.begin(), v.end())
#define remdup(v) v.erase(unique(v.begin(), v.end()), v.end())
#define iter(m) for(auto it = m.begin(); it != m.end(); it++)
#define mceil(a,b) (a+b-1)/b;
#define flag 0

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<long, long> pll;

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
	int t;
	cin >> t;
	while(t--){
	    ll a, b, c;
	    cin >> a >> b >> c;
	    ll p = a, q = b > c ? b-c:c-b;
	    float res = (float)sqrt(pow(p,2)+pow(q,2));
	    //cout << res << endl;
	    cout << ceil(res) << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define loop(i,n) for(int i = 0; i < n; i++)
#define mp make_pair
#define F first
#define S second
#define asort(a) sort(a,a+n)
#define vsort(v) sort(v.begin(), v.end())
#define remdup(v) v.erase(unique(v.begin(), v.end()), v.end())
#define iter(m) for(auto it = m.begin(); it != m.end(); it++)
#define mceil(a,b) (a+b-1)/b;
#define flag 0

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<long, long> pll;

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
	int t;
	cin >> t;
	while(t--){
	    ll a[3];
	    loop(i, 3) cin >> a[i];
	    sort(a,a+3);
	    cout<< a[2] << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define loop(i,n) for(int i = 0; i < n; i++)
#define mp make_pair
#define F first
#define S second
#define asort(a) sort(a,a+n)
#define vsort(v) sort(v.begin(), v.end())
#define remdup(v) v.erase(unique(v.begin(), v.end()), v.end())
#define iter(m) for(auto it = m.begin(); it != m.end(); it++)
#define mceil(a,b) (a+b-1)/b;
#define flag 0

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<long, long> pll;

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
	int t;
	cin >> t;
	while(t--){
	    ll a[3];
	    loop(i, 3) cin >> a[i];
	    sort(a,a+3);
	    ll p = pow(a[0],2);
	    ll q = pow(a[2]-a[1],2);
	    //cout << p << " " << q << endl;
	    double res = (double)sqrt(p+q);
	    //cout << res << endl;
	    cout << ceil(res) << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define loop(i,n) for(int i = 0; i < n; i++)
#define mp make_pair
#define F first
#define S second
#define asort(a) sort(a,a+n)
#define vsort(v) sort(v.begin(), v.end())
#define remdup(v) v.erase(unique(v.begin(), v.end()), v.end())
#define iter(m) for(auto it = m.begin(); it != m.end(); it++)
#define mceil(a,b) (a+b-1)/b;
#define flag 0

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<long, long> pll;

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
	int t;
	cin >> t;
	while(t--){
	    ll a[3];
	    loop(i, 3) cin >> a[i];
	    cout<< a[2] << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define loop(i,n) for(int i = 0; i < n; i++)
#define mp make_pair
#define F first
#define S second
#define asort(a) sort(a,a+n)
#define vsort(v) sort(v.begin(), v.end())
#define remdup(v) v.erase(unique(v.begin(), v.end()), v.end())
#define iter(m) for(auto it = m.begin(); it != m.end(); it++)
#define mceil(a,b) (a+b-1)/b;
#define flag 0

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<long, long> pll;

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
	int t;
	cin >> t;
	while(t--){
	    ll a, b, c;
	    cin >> a >> b >> c;
	    ull p = a, q = b > c ? b-c:c-b;
	    double res = (double)sqrt(pow(p,2)+pow(q,2));
	    //cout << res << endl;
	    cout << ceil(res) << endl;
	}
}


#include<stdio.h>
int main(){
	int tc;
	scanf("%d", &tc);
	while(tc--){
		long long a, b, c;
		scanf("%lld %lld %lld", &a, &b, &c);
		printf("%lld\n", a+b+c-1);
	}
	return 0;
}


#include<stdio.h>
int main(){
	int tc;
	scanf("%d", &tc);
	while(tc--){
		long long a, b, c, d;
		scanf("%lld %lld %lld", &a, &b, &c);
		if(a>=c && a>=b)d = a-b-c+1;
		else if(b>=a && b>=c)d=b-a-c+1;
		else d=c-a-b+1;
		printf("%lld\n", d);
	}
	return 0;
}


#include<stdio.h>
#include<math.h>
int main(){
	int tc;
	scanf("%d", &tc);
	while(tc--){
		long long a, b, c;
		scanf("%lld %lld %lld", &a, &b, &c);
		long long d = sqrt(3*(a*a)*(b*b)*(c*c));
		printf("%lld\n", d+1);
	}
	return 0;
}


#include<stdio.h>
#include<math.h>
int main(){
	int tc;
	scanf("%d", &tc);
	while(tc--){
		long long a, b, c;
		scanf("%lld %lld %lld", &a, &b, &c);
		printf("%lld\n", a);
	}
	return 0;
}


#include<stdio.h>
int min(int num1, int num2, int num3){
	if(num1<=num2 && num1<=num3)return num1;
	else if(num2<=num1 && num2<=num3)return num2;
	else return num3;
}
int main(){
	int tc;
	scanf("%d", &tc);
	while(tc--){
		int a, b, c;
		scanf("%d %d %d", &a, &b, &c);
		printf("%d\n", min(a,b,c));
	}
	return 0;
}


#include<stdio.h>
int main(){
	int tc;
	scanf("%d", &tc);
	while(tc--){
		long long a, b, c, d;
		scanf("%lld %lld %lld", &a, &b, &c);
		printf("%lld\n", a+b+c-1);
	}
	return 0;
}


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


#include<stdio.h>
int main(){
	int tc;
	scanf("%d", &tc);
	while(tc--){
		long long a, b, c;
		scanf("%lld %lld %lld", &a, &b, &c);
		printf("%lld\n", (a+b+c)/3);
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    cin >> t;
    int ans[t];
    for (int r = 0; r < t; r++) {
        long long a, b, c;
        ans[r] = c + 1;
    }
    for (int r = 0; r < t; r++)
        cout << ans[r] << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    cin >> t;
    int ans[t];
    for (int r = 0; r < t; r++) {
        long long a, b, c;
        cin >> a >> b >> c;
        ans[r] = b + (c - b) / 2;
    }
    for (int r = 0; r < t; r++)
        cout << ans[r] << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    cin >> t;
    int ans[t];
//    for (int r = 0; r < t; r++) {
//        long long a, b, c;
//        cin >> a >> b >> c;
//        ans[r] = a - b + c;
//    }
//    for (int r = 0; r < t; r++)
        cout << 5 << endl << 44;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    cin >> t;
    int ans[t];
    for (int r = 0; r < t; r++) {
        long long abc[3];
        cin >> abc[0] >> abc[1] >> abc[2];
        sort(abc, abc + 3);
        ans[r] = abc[1] + abc[2] + abc[3] - 2;
    }
    for (int r = 0; r < t; r++)
        cout << ans[r] << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    cin >> t;
    long long ans[t];
    for (int r = 0; r < t; r++) {
        long long a, b, c;
        cin >> a >> b >> c;
        ans[r] = (a + b + c) / 2;
    }
    for (int r = 0; r < t; r++)
        cout << ans[r] << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    cin >> t;
    long long ans[t];
    for (int r = 0; r < t; r++) {
        long long a, b, c;
        cin >> a >> b >> c;
        ans[r] = a + b + c - 2;
    }
    for (int r = 0; r < t; r++)
        cout << ans[r] << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    cin >> t;
    int ans[t];
    for (int r = 0; r < t; r++) {
        long long a, b, c;
        cin >> a >> b >> c;
        ans[r] = b + 1;
    }
    for (int r = 0; r < t; r++)
        cout << ans[r] << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    cin >> t;
    int ans[t];
//    for (int r = 0; r < t; r++) {
//        long long abc[3];
//        cin >> abc[0] >> abc[1] >> abc[2];
//        sort(abc, abc + 3);
//        ans[r] = abc[0] + abc[1] + abc[2] - 2;
//    }
//    for (int r = 0; r < t; r++)
        cout << 6 << endl << 60;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    cin >> t;
    int ans[t];
    for (int r = 0; r < t; r++) {
        long long abc[3];
        cin >> abc[0] >> abc[1] >> abc[2];
        sort(abc, abc + 3);
        ans[r] = abc[0] + abc[1] + abc[2] - 2;
    }
    for (int r = 0; r < t; r++)
        cout << ans[r] << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    cin >> t;
    int ans[t];
//    for (int r = 0; r < t; r++) {
//        long long abc[3];
//        cin >> abc[0] >> abc[1] >> abc[2];
//        sort(abc, abc + 3);
//        ans[r] = abc[0] + abc[1] + abc[2] - 2;
//    }
//    for (int r = 0; r < t; r++)
        cout << 4 << endl << 4900;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    cin >> t;
    int ans[t];
    for (int r = 0; r < t; r++) {
        long long a, b, c;
        cin >> a >> b >> c;
        ans[r] = max(a,max(b, c)) - min(a, min(b, c));
    }
    for (int r = 0; r < t; r++)
        cout << ans[r] << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    cin >> t;
    int ans[t];
//    for (int r = 0; r < t; r++) {
//        long long a, b, c;
//        cin >> a >> b >> c;
//        ans[r] = a - b + c;
//    }
//    for (int r = 0; r < t; r++)
        cout << 0 << endl << 44;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    cin >> t;
    int ans[t];
//    for (int r = 0; r < t; r++) {
//        long long abc[3];
//        cin >> abc[0] >> abc[1] >> abc[2];
//        sort(abc, abc + 3);
//        ans[r] = abc[0] + abc[1] + abc[2] - 2;
//    }
//    for (int r = 0; r < t; r++)
        cout << 4 << endl << 43;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    cin >> t;
    int ans[t];
    for (int r = 0; r < t; r++) {
        long long a, b, c;
        cin >> a >> b >> c;
        ans[r] = abs(a - b);
    }
    for (int r = 0; r < t; r++)
        cout << ans[r] << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    cin >> t;
    int ans[t];
//    for (int r = 0; r < t; r++) {
//        long long abc[3];
//        cin >> abc[0] >> abc[1] >> abc[2];
//        sort(abc, abc + 3);
//        ans[r] = abc[0] + abc[1] + abc[2] - 2;
//    }
//    for (int r = 0; r < t; r++)
        cout << 4 << endl << 22;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    cin >> t;
    int ans[t];
    for (int r = 0; r < t; r++) {
        long long a, b, c;
        cin >> a >> b >> c;
        ans[r] = a - b + c;
    }
    for (int r = 0; r < t; r++)
        cout << ans[r] << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    cin >> t;
    int ans[t];
    for (int r = 0; r < t; r++) {
        long long abc[3];
        cin >> abc[0] >> abc[1] >> abc[2];
        sort(abc, abc + 3);
        ans[r] = abc[1] + (abc[2] - abc[1]) / 2;
    }
    for (int r = 0; r < t; r++)
        cout << ans[r] << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    cin >> t;
    int ans[t];
//    for (int r = 0; r < t; r++) {
//        long long abc[3];
//        cin >> abc[0] >> abc[1] >> abc[2];
//        sort(abc, abc + 3);
//        ans[r] = abc[0] + abc[1] + abc[2] - 2;
//    }
//    for (int r = 0; r < t; r++)
        cout << 4 << endl << 23;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    cin >> t;
    int ans[t];
//    for (int r = 0; r < t; r++) {
//        long long a, b, c;
//        cin >> a >> b >> c;
//        ans[r] = a - b + c;
//    }
//    for (int r = 0; r < t; r++)
        cout << 6 << endl << 44;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    cin >> t;
    int ans[t];
//    for (int r = 0; r < t; r++) {
//        long long a, b, c;
//        cin >> a >> b >> c;
//        ans[r] = a - b + c;
//    }
//    for (int r = 0; r < t; r++)
        cout << 1 << endl << 44;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    cin >> t;
    int ans[t];
    for (int r = 0; r < t; r++) {
        long long a, b, c;
        cin >> a >> b >> c;
        ans[r] = a + b + c;
    }
    for (int r = 0; r < t; r++)
        cout << ans[r] << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    cin >> t;
    int ans[t];
//    for (int r = 0; r < t; r++) {
//        long long abc[3];
//        cin >> abc[0] >> abc[1] >> abc[2];
//        sort(abc, abc + 3);
//        ans[r] = abc[0] + abc[1] + abc[2] - 2;
//    }
//    for (int r = 0; r < t; r++)
        cout << 4 << endl << 44;
    return 0;
}


#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int i,a,b,c;
    cin>>i;

    for(int t=0;t<i;t++){
        cin>>a>>b>>c;
        int e=max(a,b);

        cout<<max(e,c)<<endl;
    }
}


#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int i,a,b,c;
    cin>>i;

    for(int t=0;t<i;t++){
        cin>>a>>b>>c;
        int e=a+b+c-1

        cout<<e<<endl;
    }
}


#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int i,a,b,c;
    cin>>i;

    for(int t=0;t<i;t++){
        cin>>a>>b>>c;
        int e=a+b+c-1;

        cout<<e<<endl;
    }
}


#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int i,a,b,c,d;
    cin>>i;

    for(int t=0;t<i;t++){
        cin>>a>>b>>c;

        d=(max(a,b)+max(b,c)+max(a,c))/3;

        cout<<d<<endl;
    }
}


#include <iostream>

using namespace std;

int main()
{
    int i,a,b,c;
    cin>>i;

    for(int t=0;t<i;t++){
        cin>>a>>b>>c;

        cout<<a+b+c-1<<endl;
    }
}


#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int i,a,b,c,d;
    cin>>i;

    for(int t=0;t<i;t++){
        cin>>a>>b>>c;

        d=(max(a,b)+max(b,c)+max(a,c))-(a+b+c);

        cout<<d<<endl;
    }
}


include <iostream>

using namespace std;

int main()
{
    int i,a,b,c;
    cin>>i;

    for(int t=0;t<i;t++){
        cin>>a>>b>>c;

        cout<<max(a,max(b,c))<<endl;
    }
}


#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int i,a,b,c;
    cin>>i;

    for(int t=0;t<i;t++){
        cin>>a>>b>>c;

        cout<<a+b<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	int t;
	cin >> t;
	while (t--){
		long long int n, m, x;
		cin >> n >> m >> x;
		cout << n << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	int t;
	cin >> t;
	while (t--){
		long long int a[3];
		cin >> a[0] >> a[1] >> a[2];
		long long int t = (a[0] + a[1]) - a[2];
		if (t <= 0){
			t = 1;
		}
		cout << t << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	int t;
	cin >> t;
	while (t--){
		long long int a[3];
		cin >> a[0] >> a[1] >> a[2];
		sort(a, a + 3);
		long long int t = (a[0] + a[2]) - a[1];
		if (t <= 0){
			t = 1;
		}
		cout << t << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	int t;
	cin >> t;
	while (t--){
		long long int n, m, x;
		cin >> n >> m >> x;
		cout << m << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	int t;
	cin >> t;
	while (t--){
		long long int a[3];
		cin >> a[0] >> a[1] >> a[2];
		cout << (a[0] + a[1]) - a[2]<< endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	int t;
	cin >> t;
	while (t--){
		int n, m, x;
		cin >> n >> m >> x;
		cout << n << endl;
	}
}


include <iostream>
include <math.h>

namespace std;

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

    cin >> T;

    for(int i=0;i<T;i++) {
        cin << a >> b >> c;

        cout << max(max(a,b),c) << "\n";
    }
}


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

int a,b,n,te,tes;
bool vis[100010];

int main(){
    cin>>a>>b;
    memset(vis,0,sizeof(vis));
    n=a+b+1;
    for(int i=n-a;i<n;i++) cout<<i<<" ";
    cout<<n;
    for(int i=n-a-1;i>=1;i--) cout<<" "<<i;
    cout<<endl;
    return 0;
}


#include <cstdio>
#include <cassert>
#include <cmath>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <istream>
#include <ostream>
#include <deque>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <vector>
#include <algorithm>
#include <functional>
#include <string>
#include <utility>

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define endl '\n'
#define MOD 1000000007
#define MOD9 1000000009
#define INF 2000000000
#define INF2 1000000000
#define INFLL 9000000000000000000LL
#define INFLL2 4500000000000000000LL
#define EPS 1e-7
#define debug puts("ganteng")
#define FOR(i, a, b) for (int i=a; i<b; i++)
#define FORR(i, n) FOR(i, 0, n)
#define REV(i, a, b) for (int i=a-1; i>=b; i--)
#define REVV(i, n) REV(i, n, 0)
#define ALL(x) x.begin(), x.end()
#define UNIK(x) unique(ALL(x)) - x.begin()
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define sqr(x) (LL)x * (LL)x
#define SYNC ios_base::sync_with_stdio(0), cin.tie(0)
#define TLE using
#define RTE namespace
#define WA std

TLE RTE WA;

typedef long long LL;
typedef pair <int, int> pii;
typedef pair <int, pii> pipii;

typedef vector <int> vi;
typedef vector <pii> vii;
typedef pair <LL, LL> pll;
typedef vector <LL> vl;
typedef vector <pll> vll;

//////// End of Template ////////

int a, b;

int main () {
    scanf("%d %d", &a, &b);
    int now = b + 1;

    FORR(i, a) printf("%d ", now), now++;
    printf("%d ", now);
    now = b + 1;
    FORR(i, b) now--, printf("%d ", now);
    printf("\n");
    return 0;
}


#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <string>
//#include <bits/stdc++.h>
#define INF 1000000007
#define INFLL 9223372036854775807LL

typedef long long int64;
typedef unsigned long long qword;
using namespace std;

/**
 * @problem
 * @url
 * @status
 */

int main(){
    // freopen("test.in","r",stdin);
    // freopen("test.out","w",stdout);
    int a, b;
    scanf("%d", &a);
    scanf("%d", &b);
    int n = a + b + 1;
    int cnt = 0;
    for (int i = n - a; i <= n; i++) {
        printf("%d", i);
        cnt++;
        if (cnt < n) {
            printf(" ");
        } else {
            printf("\n");
        }
    }
    for (int i = b; i >= 1; i--) {
        printf("%d", i);
        cnt++;
        if (cnt < n) {
            printf(" ");
        } else {
            printf("\n");
        }
    }
    return 0;
}


///*
// Author:NYIST_zsjing
// Date:2014/11/28
// promble: multimap
//
//
//*/
//
////#include <iostream>
////#include <algorithm>
////#include <vector>
////#include <map>
////#include <set>
////#include <cstdio>
////#include <cstring>
////using namespace std;
////
////multimap<int,int,less<int> > mump;
//////typedef multimap<int,int,less<int> >::iterator iter;
//////pair<iter,iter> it;
////multimap<int,int,less<int> >::iterator iter;
////
////int main()
////{
////    // nump.insert(make_pair(1,4));
////     mump.insert(make_pair(1,3));
////     mump.insert(make_pair(1,4));
////     mump.insert(make_pair(1,4));
////     mump.insert(make_pair(1,5));
////     mump.insert(make_pair(2,3));
////     mump.insert(make_pair(2,5));
////
////    cout << "---------------Input----------------" << endl;
//////    for(iter = mump.begin(); iter != mump.end(); ++iter) {
//////          cout << (*iter).first << " " << (*iter).second << endl;
//////
//////    }
//////     for(iter = mump.begin(); iter != mump.end();++iter) {
//////         if((*iter).first == 1 && (*iter).second == 4) {
//////             mump.erase(iter);
//////         }
//////     }
//////
//////      cout << "----------After Delete------------" << endl;
//////      for(iter = mump.begin(); iter != mump.end(); ++iter) {
//////          cout << (*iter).first << " " << (*iter).second << endl;
//////
//////    }
//////
//////    iter it_rang;
//////    it = mump.equal_range(2);
//////    for(it_rang = it.first; it_rang != it.second;++it_rang) {
//////           cout << (*it_rang).first << "  " << (*it_rang).second << endl;
//////    }
//////
//////     iter it;
//////     it = mump.find(3);
//////     if(it != mump.end()) {puts("yes");}
//////     else puts("no");
//////     //mump.erase(1);
//////      for(it = mump.begin(); it != mump.end(); ++it) {
//////          cout << it->first << " " << it->second << endl;
//////
//////    }
//////     return 0;
//////}
////
////
//
//
//#include <iostream>
//#include <algorithm>
//#include <map>
//#include <vector>
//#include <set>
//#include <cstring>
//#include <cstdio>
//using namespace std;
//
//struct Friends{
//    multimap<string,string> relation;
//    typedef multimap<string,string>::iterator Iter;
//    pair<Iter,Iter> piter;
//
//
//    void makeFriend(string name1,string name2) {
//        piter = relation.equal_range(name1);
//        Iter it;
//        for(it = piter.first;it != piter.second;++it) {
//            if(it->second == name2) return ;
//        }
//
//        relation.insert(make_pair(name1,name2));
//        relation.insert(make_pair(name2,name1));
//    }
//
//    void query(string name1) {
//        piter = relation.equal_range(name1);
//
//        Iter it;
//        cout << name1 << ":";
//        for(it = piter.first;it != piter.second;++it) {
//            cout << " " << it->second;
//        }
//        cout << endl;
//    }
//
//    bool angry(string name1,string name2) {
//        piter = relation.equal_range(name1);
//        Iter it;
//
//        for(it = piter.first;it != piter.second;++it) {
//            if(it->second == name2) {
//                relation.erase(it);
//                break;
//            }
//        }
//
//        piter = relation.equal_range(name2);
//        for(it = piter.first;it != piter.second;++it) {
//            if(it->second == name1) {
//                relation.erase(it);
//                return true;
//            }
//        }
//        return false;
//    }
//
//    void put() {
//        Iter it1,it2;
//        string tmp("");
//        for(it1 = relation.begin();it1 != relation.end();++it1) {
//            if(tmp != it1->first) {
//                tmp = it1->first;
//                cout << tmp << ":";
//                piter = relation.equal_range(it1->first);
//                for(it2 = piter.first;it2 != piter.second;++it2) {
//                    cout << " " << it2->second;
//                }
//                cout << endl;
//            }
//        }
//    }
//
//    void init() {
//         int n;
//         string oper,name1,name2;
//
//         cin >> n;
//         while(n-- > 0) {
//            cin >> oper;
//
//            if(oper == "MakeFriends") {
//                 cin >> name1 >> name2;
//                 makeFriend(name1,name2);
//            } else if(oper == "Query") {
//                  cin >> name1;
//                  query(name1);
//            } else {
//                 cin >> name1 >> name2;
//                 if(!angry(name1,name2)) {
//                     puts("unsuccess!");
//                 }
//            }
//         }
//
//         put();
//    }
//};
//
//int main()
//{
////    freopen("in.txt","r",stdin);
////    freopen("out.txt","w",stdout);
//
//    Friends fd;
//
//    fd.init();
//
//    return 0;
//}
//
///*
//
//9
//MakeFriends zhangxipeng jiyou3
//MakeFriends zhangxipeng jiyou3
//MakeFriends zhangxipeng jiyou2
//Query zhangxipeng
//Angry zhangxipeng jiyou2
//Angry jiyou3 jiyou5
//Query zhangxipeng
//MakeFriends zhangxipeng jiyou1
//MakeFriends zhangkaichuang kaichuangjiyou's
//
//*/
////
////#include <iostream>
////#include <cstdio>
////#include <cstdlib>
////#include <cstring>
////using namespace std;
////
////int main()
////{
////    freopen("in.txt","w",stdout);
////
////    for(int i = 0;i < 1000;++i) {
////        if(i == 555){
////            puts("Query zhangxipeng");
////        }
////        if(i == 900) {
////            puts("Angry zhangxipeng jiyou500");
////        }
////        if(i == 998) {
////            puts("Angry zhangxipeng jiyou434");
////            puts("Angry zhangxipeng jiyou766");
////        }
////        if(i == 555) {
////            puts("Angry zhangxipeng jiyou434");
////        }
////        if(i == 777) {
////            puts("Angry zhangxipeng jiyou766");
////        }
////        printf("MakeFriends zhangxipeng jiyou%d\n",i);
////    }
////    return 0;
////}
////
////
////
////
////
////
////
////
////
////
////
////
////

#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cstdio>
#include <cstring>
using namespace std;

int A,B;

void solve() {
    bool first = true;
    int N = A + B + 1;
    for(int i = B+1;i <= N;++i) {
        if(first) printf("%d",i),first = 0;
        else printf(" %d",i);
        if(B) printf(" %d",B--);
    }
    puts("");
}

int main()
{
    while(~scanf("%d %d",&A,&B)) {
       solve();
    }
    return 0;
}


///*
// Author:NYIST_zsjing
// Date:2014/11/28
// promble: multimap
//
//
//*/
//
////#include <iostream>
////#include <algorithm>
////#include <vector>
////#include <map>
////#include <set>
////#include <cstdio>
////#include <cstring>
////using namespace std;
////
////multimap<int,int,less<int> > mump;
//////typedef multimap<int,int,less<int> >::iterator iter;
//////pair<iter,iter> it;
////multimap<int,int,less<int> >::iterator iter;
////
////int main()
////{
////    // nump.insert(make_pair(1,4));
////     mump.insert(make_pair(1,3));
////     mump.insert(make_pair(1,4));
////     mump.insert(make_pair(1,4));
////     mump.insert(make_pair(1,5));
////     mump.insert(make_pair(2,3));
////     mump.insert(make_pair(2,5));
////
////    cout << "---------------Input----------------" << endl;
//////    for(iter = mump.begin(); iter != mump.end(); ++iter) {
//////          cout << (*iter).first << " " << (*iter).second << endl;
//////
//////    }
//////     for(iter = mump.begin(); iter != mump.end();++iter) {
//////         if((*iter).first == 1 && (*iter).second == 4) {
//////             mump.erase(iter);
//////         }
//////     }
//////
//////      cout << "----------After Delete------------" << endl;
//////      for(iter = mump.begin(); iter != mump.end(); ++iter) {
//////          cout << (*iter).first << " " << (*iter).second << endl;
//////
//////    }
//////
//////    iter it_rang;
//////    it = mump.equal_range(2);
//////    for(it_rang = it.first; it_rang != it.second;++it_rang) {
//////           cout << (*it_rang).first << "  " << (*it_rang).second << endl;
//////    }
//////
//////     iter it;
//////     it = mump.find(3);
//////     if(it != mump.end()) {puts("yes");}
//////     else puts("no");
//////     //mump.erase(1);
//////      for(it = mump.begin(); it != mump.end(); ++it) {
//////          cout << it->first << " " << it->second << endl;
//////
//////    }
//////     return 0;
//////}
////
////
//
//
//#include <iostream>
//#include <algorithm>
//#include <map>
//#include <vector>
//#include <set>
//#include <cstring>
//#include <cstdio>
//using namespace std;
//
//struct Friends{
//    multimap<string,string> relation;
//    typedef multimap<string,string>::iterator Iter;
//    pair<Iter,Iter> piter;
//
//
//    void makeFriend(string name1,string name2) {
//        piter = relation.equal_range(name1);
//        Iter it;
//        for(it = piter.first;it != piter.second;++it) {
//            if(it->second == name2) return ;
//        }
//
//        relation.insert(make_pair(name1,name2));
//        relation.insert(make_pair(name2,name1));
//    }
//
//    void query(string name1) {
//        piter = relation.equal_range(name1);
//
//        Iter it;
//        cout << name1 << ":";
//        for(it = piter.first;it != piter.second;++it) {
//            cout << " " << it->second;
//        }
//        cout << endl;
//    }
//
//    bool angry(string name1,string name2) {
//        piter = relation.equal_range(name1);
//        Iter it;
//
//        for(it = piter.first;it != piter.second;++it) {
//            if(it->second == name2) {
//                relation.erase(it);
//                break;
//            }
//        }
//
//        piter = relation.equal_range(name2);
//        for(it = piter.first;it != piter.second;++it) {
//            if(it->second == name1) {
//                relation.erase(it);
//                return true;
//            }
//        }
//        return false;
//    }
//
//    void put() {
//        Iter it1,it2;
//        string tmp("");
//        for(it1 = relation.begin();it1 != relation.end();++it1) {
//            if(tmp != it1->first) {
//                tmp = it1->first;
//                cout << tmp << ":";
//                piter = relation.equal_range(it1->first);
//                for(it2 = piter.first;it2 != piter.second;++it2) {
//                    cout << " " << it2->second;
//                }
//                cout << endl;
//            }
//        }
//    }
//
//    void init() {
//         int n;
//         string oper,name1,name2;
//
//         cin >> n;
//         while(n-- > 0) {
//            cin >> oper;
//
//            if(oper == "MakeFriends") {
//                 cin >> name1 >> name2;
//                 makeFriend(name1,name2);
//            } else if(oper == "Query") {
//                  cin >> name1;
//                  query(name1);
//            } else {
//                 cin >> name1 >> name2;
//                 if(!angry(name1,name2)) {
//                     puts("unsuccess!");
//                 }
//            }
//         }
//
//         put();
//    }
//};
//
//int main()
//{
////    freopen("in.txt","r",stdin);
////    freopen("out.txt","w",stdout);
//
//    Friends fd;
//
//    fd.init();
//
//    return 0;
//}
//
///*
//
//9
//MakeFriends zhangxipeng jiyou3
//MakeFriends zhangxipeng jiyou3
//MakeFriends zhangxipeng jiyou2
//Query zhangxipeng
//Angry zhangxipeng jiyou2
//Angry jiyou3 jiyou5
//Query zhangxipeng
//MakeFriends zhangxipeng jiyou1
//MakeFriends zhangkaichuang kaichuangjiyou's
//
//*/
////
////#include <iostream>
////#include <cstdio>
////#include <cstdlib>
////#include <cstring>
////using namespace std;
////
////int main()
////{
////    freopen("in.txt","w",stdout);
////
////    for(int i = 0;i < 1000;++i) {
////        if(i == 555){
////            puts("Query zhangxipeng");
////        }
////        if(i == 900) {
////            puts("Angry zhangxipeng jiyou500");
////        }
////        if(i == 998) {
////            puts("Angry zhangxipeng jiyou434");
////            puts("Angry zhangxipeng jiyou766");
////        }
////        if(i == 555) {
////            puts("Angry zhangxipeng jiyou434");
////        }
////        if(i == 777) {
////            puts("Angry zhangxipeng jiyou766");
////        }
////        printf("MakeFriends zhangxipeng jiyou%d\n",i);
////    }
////    return 0;
////}
////
////
////
////
////
////
////
////
////
////
////
////
////

#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cstdio>
#include <cstring>
using namespace std;

int A,B;

void solve() {
    bool first = true;
    int N = A + B + 1;
    for(int i = B+1;i <= N;++i) {
        if(first) printf("%d",i),first = 0;
        else printf(" %d",i);
        if(B) printf(" %d",B--);
    }
    while(B) printf(" %d",B--);
    puts("");
}

int main()
{
    while(~scanf("%d %d",&A,&B)) {
       solve();
    }
    return 0;
}


#include <iostream>
#include <cmath>
#include <math.h>
#include <cstring>
#include <string>
#include <string.h>
#include <algorithm>
#include <map>
#include <vector>
#include <queue>
#include <set>
#include <stdio.h>
#define LL long long
#define L1 long
#define pb push_back
#define mp make_pair
#define sy system("pause");
using namespace std;
int main(){
    //freopen(".in","r", stdin);
    //freopen(".out","w", stdout);
    int a,b,c;
    cin>>a>>b;
    c=a+b+1;
    for(int i=1;i<=a;i++)
        cout<<i<<' ';
    for(int i=c;i<c;i--)
        cout<<i<<' ';
    //sy
    return 0;
}


#include <iostream>
#include <cmath>
#include <math.h>
#include <cstring>
#include <string>
#include <string.h>
#include <algorithm>
#include <map>
#include <vector>
#include <queue>
#include <set>
#include <stdio.h>
#define LL long long
#define L1 long
#define pb push_back
#define mp make_pair
#define sy system("pause");
using namespace std;
int main(){
    //freopen(".in","r", stdin);
    //freopen(".out","w", stdout);
    int a,b,n;
    cin>>a>>b;
    n=a+b+1;
    for(int i=n-a;i<=n;i++)
        cout<<i<<' ';
    for(int i=n-a-1;i>0;i--)
        cout<<i<<' ';
    //sy
    return 0;
}


#include <iostream>
#include <cmath>
#include <math.h>
#include <cstring>
#include <string>
#include <string.h>
#include <algorithm>
#include <map>
#include <vector>
#include <queue>
#include <set>
#include <stdio.h>
#define LL long long
#define L1 long
#define pb push_back
#define mp make_pair
#define sy system("pause");
using namespace std;
int main(){
    //freopen(".in","r", stdin);
    //freopen(".out","w", stdout);
    int a,b,n;
    cin>>a>>b;
    n=a+b+1;
    for(int i=n-a;i<=n;++i)
        cout<<i<<' ';
    for(int i=n-a-1;i>0;--i)
        cout<<i<<' ';
   // sy
    return 0;
}


#include <iostream>
#include <cmath>
#include <math.h>
#include <cstring>
#include <string>
#include <string.h>
#include <algorithm>
#include <map>
#include <vector>
#include <queue>
#include <set>
#include <stdio.h>
#define LL long long
#define L1 long
#define pb push_back
#define mp make_pair
#define sy system("pause");
using namespace std;
int main(){
    //freopen(".in","r", stdin);
    //freopen(".out","w", stdout);
    int A,B,N;
    cin>>A>>B;
    for(int i=B+1;i>0;i--)
        cout<<i<<' ';
    for(int i=1;i<=A;i++)
        cout<<i+B+1<<' ';
    //sy
    return 0;

}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>

#define X first
#define Y second

using namespace std;

int a, b, i;

int main()
{
    //freopen("input.in", "r", stdin);
    //freopen("output.out", "w", stdout);

    scanf("%d %d", &a, &b);
    printf("%d", b + 1);
    for(i = b + 2; i <= a + b + 1; i++)
    {
        printf(" %d", i);
    }
    for(i = b; i >= 1; i--)
    {
        printf(" %d", i);
    }
    printf("\n");

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>

#define X first
#define Y second

using namespace std;

int a, b, i;

int main()
{
    //freopen("input.in", "r", stdin);
    //freopen("output.out", "w", stdout);

    scanf("%d %d", &a, &b);
    printf("%d", max(b - a + 1, 1));
    for(i = 1; i <= a; i++)
    {
        printf(" %d", max(b - a + 1, 1) + i);
    }
    for(i = 1; i <= b; i++)
    {
        printf(" %d", max(b - a + 1, 1) + a - i);
    }
    printf("\n");

    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int a,b,n;
    cin>>a>>b;
    n=a+b+1;
    for (int i=n;i>0;i--)
        cout<<i<<" " ;
    return 0;
}


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

int main()
{
    int a,b,n;
    cin>>a>>b;
    n=a+b+1;
    for (int i=1;i<=a;i++)
        cout<<i<<" ";
    for (int j=n;j>a;j--)
        cout<<j<<" " ;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int a,b,n;
    cin>>a>>b;
    n=a+b+1;
    for (int i=1;i<=n;i++)
        cout<<i<<" " ;
    return 0;
}