#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
	string str; cin >> str;
	int len=str.size();
	vector<int> v,num;
	for(int i=0;i<len;i++)
	{
		int cnt=0;
		while(i+1<=len-1 && str[i]==str[i+1]) {i++; cnt++;}
		v.push_back(cnt); num.push_back(i);
	}
	int n ; cin >> n ;
	while(n--)
	{
		int l,r; cin >> l >> r ;
		int sum=0; l--,r--;
		int i=0;
		while(i<num.size() && num[i]<l) i++;
		int j=i;
		while(j<num.size() && num[j]<r) j++;
		if(i==j) sum=r-l;
		else
		{
			sum=(num[i]-l)+(r-num[j-1]-1);
			for(int k=i+1;k<j;k++) sum+=v[k];

		}
		cout << sum << endl;
	}
}


#include <iostream>
#include <string>
using namespace std;
int main()
{
	string str; cin >> str;
	int len=str.size();
	int n ; cin >> n ;
	while(n--)
	{
		int l,r; cin >> l >> r ;
		int cnt=0; l--,r--;
		for(int i=l;i<=r;i++)
			if(i+1<=r && str[i]==str[i+1]) cnt++;
		cout << cnt << endl;
	}
}


#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
	string str; cin >> str;
	int len=str.size();
	vector<int> num;
	for(int i=0;i<len;i++)
	{
		int cnt=0;
		while(i+1<=len-1 && str[i]==str[i+1]) i++;
		num.push_back(i);
	}
	int n ; cin >> n ;
	while(n--)
	{
		int l,r; cin >> l >> r ;
		int sum=0; l--,r--;
		int i=0;
		while(i<num.size() && num[i]<l) i++;
		int j=i;
		while(j<num.size() && num[j]<r) j++;
		sum=r-l-(j-i);
		cout << sum << endl;
	}
}


#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
	string str; cin >> str;
	int len=str.size();
	int num[100001];
	int cnt=0; num[0]=0;
	for(int i=0;i<len-1;i++)
	{
		if(str[i]==str[i+1]) num[i+1]=cnt;
		else num[i+1]=++cnt;
	}
	int n ; cin >> n ;
	while(n--)
	{
		int l,r; cin >> l >> r ;
		int sum=0; l--,r--;
		sum=r-l-(num[r]-num[l]);
		cout << sum << endl;
	}
}


#include <stdio.h>
#include <vector>
#include <algorithm>
#include <windows.h>
char a[100005];
int main()
{
	gets(a);
	int n, l, r, cnt, size;
	size = strlen(a);
	for (int i = 0; i < size - 1; ++i)
	{
		if (a[i] == a[i + 1]) a[i] = 1;
		else a[i] = 0;
	}
	scanf("%d", &n);
	for (int i = 0; i < n; ++i)
	{
		cnt = 0;
		scanf("%d%d", &l, &r);
		for (int j = l-1; j < r-1; ++j)
		{
			cnt += a[j];
		}
		printf("%d\n", cnt);
	}
	return 0;
}


#include <stdio.h>
#include <vector>
#include <algorithm>
#include <windows.h>
char a[100005];
int main()
{
	gets(a);
	int n, l, r, cnt;
	scanf("%d", &n);
	for (int i = 0; i < n; ++i)
	{
		cnt = 0;
		scanf("%d%d", &l, &r);
		for (int j = l-1; j < r-1; ++j)
		{
			if (a[j] == a[j+1]) ++cnt;
		}
		printf("%d\n", cnt);
	}
	return 0;
}


#include <iostream>
#include <string>

using namespace std;

int a[300000];
char str[300000];

int main()
{
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	scanf("%s", str);
	int n = strlen(str);
	for (int i = 1; i < n; i++)
	{
		if (str[i - 1] == str[i])
			a[i - 1] = 1;
		else
			a[i - 1] = 0;
	}

	a[n - 1] = 0;

	for (int i = n - 2; i >= 0; i--)
		a[i] += a[i + 1];

	int m;
	cin >> m;
	for (int i = 0; i < m; i++)
	{
		int l, r;
		scanf("%d %d", &l, &r);
		printf("%d\n", a[l - 1] - a[r - 1]);
	}

}


#include <iostream>
using namespace std;
int main(){
	int k,i;
	int a[100001]={0};
	int x,y;
	char s[100001];
	cin>>s>>k;
	for(i=1;s[i];i++){
		if(s[i]==s[i-1]){
			a[i]=a[i-1]+1;
		}
		else{
			a[i]=a[i-1];
		}
	}
	for(i=0;i<k;i++){
		cin>>x>>y;
		cout<<a[y-1]-a[x-1]<<endl;
	}
	return 0;
}


#include <iostream>
using namespace std;
int main(){
	char a[100001];
	int m,i;
	int res,k,l;
	cin>>a>>m;
	for(i=0;i<m;i++){
		cin>>k>>l;
		for(res=0,k--,l--;k<l;k++){
			if(a[k]==a[k+1]){
				res++;
			}
		}
		cout<<res<<endl;
	}
	return 0;
}


//#include <algorithm>
#include <iostream>
#include <string.h>
#include <string>

using namespace std;

char a, b;
int arr[100000];
int m, l, r;

int main()
{
	cin.get(a);
	cin.get(b);
	int i = 1;
	while (b != '\n')
	{
		if (a == b)
			arr[i+1] = arr[i]+1;
		else
			arr[i+1] = arr[i];
		a = b;
		cin.get(b);
		i++;
	}
	cin >> m;
	for (int i=0; i<m; i++)
	{
		cin >> l >> r;
		//cout << count(arr+l, arr+r, 1) << endl;
		cout<<arr[r]-arr[l]<<endl;
	}
	return 0;
}


//#include <algorithm>
#include <iostream>
#include <string.h>
#include <string>

using namespace std;

char a, b;
int arr[100000];
int m, l, r;

int main()
{
	cin.get(a);
	cin.get(b);
	int i = 0;
	while (b != '\n')
	{
		if (a == b)
			arr[i+1] = arr[i]++;
		else
			arr[i+1] = arr[i];
		a = b;
		cin.get(b);
		i++;
	}
	cin >> m;
	for (int i=0; i<m; i++)
	{
		cin >> l >> r;
		//cout << count(arr+l, arr+r, 1) << endl;
		cout<<arr[r]-arr[l]<<endl;
	}
	return 0;
}


//#include <algorithm>
#include <iostream>
#include <string.h>
#include <string>

using namespace std;

char a, b;
int arr[100001];
int m, l, r;

int main()
{
	cin.get(a);
	cin.get(b);
	int i = 1;
	while (b != '\n')
	{
		if (a == b)
			arr[i+1] = arr[i]+1;
		else
			arr[i+1] = arr[i];
		a = b;
		cin.get(b);
		i++;
	}
	cin >> m;
	for (int i=0; i<m; i++)
	{
		cin >> l >> r;
		//cout << count(arr+l, arr+r, 1) << endl;
		cout<<arr[r]-arr[l]<<endl;
	}
	return 0;
}


//#include <algorithm>
#include <iostream>
#include <string.h>
#include <string>

using namespace std;

char a, b;
int arr[100000];
int m, l, r;

int main(void)
{
	cin.get(a);
	cin.get(b);
	int i = 1;
	while (b != '\n')
	{
		if (a == b)
			arr[i+1] = arr[i]+1;
		else
			arr[i+1] = arr[i];
		a = b;
		cin.get(b);
		i++;
	}
	cin >> m;
	for (int i=0; i<m; i++)
	{
		cin >> l >> r;
		//cout << count(arr+l, arr+r, 1) << endl;
		cout<<arr[r]-arr[l];
	}
	return 0;
}


//#include <algorithm>
#include <iostream>
#include <string.h>
#include <string>

using namespace std;

char a, b;
int arr[100000];
int m, l, r;

int main(void)
{
	cin.get(a);
	cin.get(b);
	int i = 1;
	while (b != '\n')
	{
		if (a == b)
			arr[i+1] = arr[i]+1;
		else
			arr[i+1] = arr[i];
		a = b;
		cin.get(b);
		i++;
	}
	cin >> m;
	for (int i=0; i<m; i++)
	{
		cin >> l >> r;
		//cout << count(arr+l, arr+r, 1) << endl;
		cout<<arr[r]-arr[l]<<endl;
	}
	return 0;
}


//#include <algorithm>
#include <iostream>
#include <string.h>
#include <string>

using namespace std;

char a, b;
int arr[100001];
int m, l, r;

int main()
{
	cin.get(a);
	cin.get(b);
	int i = 1;
	while (b != '\n')
	{
		if (a == b)
			arr[i+1] = arr[i]++;
		else
			arr[i+1] = arr[i];
		a = b;
		cin.get(b);
		i++;
	}
	cin >> m;
	for (int i=0; i<m; i++)
	{
		cin >> l >> r;
		//cout << count(arr+l, arr+r, 1) << endl;
		cout<<arr[r]-arr[l]<<endl;
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main() {
    /*int m,q,w;
    string s;
    cin>>s;
    cin>>m;
    vector<int> g;
    vector<int> d(m);
    int c=0;
    vector<int> v;
    for(int i=0;i<m;i++)

    {
    cin>>q>>w;
    q--;
    w--;
    for(int i=q;i<w;i++)
        if(s[i]==s[i+1])  c++;

    d[i]=c;
    c=0;
    }
    for(int i=0;i<m;i++)
        cout<<d[i]<<endl;

    */
    int m,n,k,c=0;
    string s;
    cin>>s;
    cin>>m;
    vector<int> g(s.size()-1),x,y,d;
    for(int i=0;i<s.size()-1;i++)
        if(s[i]==s[i+1]) g[i]=1;
        else g[i]=0;
        for(int i=0;i<m;i++){
            cin>>n>>k;
            n--;k--;
            for(int i=n;i<k;i++)
                c+=g[i];
            d.push_back(c);
            c=0;
        }
        for(int i=0;i<d.size();i++)
            cout<<d[i]<<endl;

}


#define _CRT_SECURE_NO_WARNINGS
#include<cstdio>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<set>
#include<map>
#include<set>
#include<queue>
#include<cmath>
#include<iomanip>
#include<stack>
#define ll long long
using namespace std;
#pragma comment(linker,"/STACK:102400000,102400000")
int main() {
    string s;
    cin >> s;
    int m;
    cin >> m;
    vector<int> dp(s.size()),S(s.size());
    for (int i = 0; i < s.size()-1; i++) {
        dp[i+1] = s[i] == s[i + 1];
    }
    for (int i = 0; i < s.size(); i++) {
        if (i) S[i] = S[i - 1] + dp[i];
        else S[i] = dp[i];
    }
    int l, r;
    for (int i = 0; i < m; i++) {
        cin >> l >> r;
        l--;
        r--;
        cout << S[r] - S[l] << endl;
    }

}


#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main() {
    int m,q,w;
    string s;
    cin>>s;
    cin>>m;
    vector<int> g;
    vector<int> d(m);
    int c=0;
    vector<int> v;
    for(int i=0;i<m;i++)

    {
    cin>>q>>w;
    q--;
    w--;
    for(int i=q;i<w;i++)
        if(s[i]==s[i+1])  c++;

    d[i]=c;
    c=0;
    }
    for(int i=0;i<m;i++)
        cout<<d[i]<<endl;

}


#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main() {
    /*int m,q,w;
    string s;
    cin>>s;
    cin>>m;
    vector<int> g;
    vector<int> d(m);
    int c=0;
    vector<int> v;
    for(int i=0;i<m;i++)

    {
    cin>>q>>w;
    q--;
    w--;
    for(int i=q;i<w;i++)
        if(s[i]==s[i+1])  c++;

    d[i]=c;
    c=0;
    }
    for(int i=0;i<m;i++)
        cout<<d[i]<<endl;

    */
    int m,n,k,c=0,p=0;
    string s;
    cin>>s;
    cin>>m;
    vector<int> g(s.size()-1),x,y,d;
    for(int i=0;i<s.size()-1;i++)
        if(s[i]==s[i+1]) g[i]=1;
        else g[i]=0;
        for(int i=0;i<g.size();i++)
            if(g[i]!=0) p++;
        if(p==0) {for(int i=0;i<m;i++)
            cout<<0<<endl;
        return 0;}

        for(int i=0;i<m;i++){
            cin>>n>>k;
            n--;k--;
            for(int i=n;i<k;i++)
                c+=g[i];
            d.push_back(c);
            c=0;
        }
        for(int i=0;i<d.size();i++)
            cout<<d[i]<<endl;

}


#include<iostream>
using namesapce std;

int main()
{
    int n,m;

    cin>>n>>m;

    if(n>m)
    {
        for(int i=0;i<m;i++)
            cout<<"BG";
        for(int i =0;i<n-m;i++)
            cout<<"B";

    }
    else
    {
        for(int i=0;i<m;i++)
            cout<<"GB";
        for(int i =0;i<m-n;i++)
            cout<<"G";

    }

    return 0;
}


#include<iostream>
using namespace std;

int main()
{
    int n1,m;

    cin>>n1>>m;

    if(n1>m)
    {
        for(int i=0;i<m;i++)
            cout<<"BG";
        for(int i =0;i<n1-m;i++)
            cout<<"B";

    }
    else
    {
        for(int i=0;i<m;i++)
            cout<<"GB";
        for(int i =0;i<m-n1;i++)
            cout<<"G";

    }

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n,m;
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    cin>>n>>m;

    if(n>m)
    {
        for(int i=0;i<m;i++)
            cout<<"BG";
        for(int i =0;i<n-m;i++)
            cout<<"B";

    }
    else
    {
        for(int i=0;i<n;i++)
            cout<<"GB";
        for(int i =0;i<m-n;i++)
            cout<<"G";

    }

    return 0;
}


#include<iostream>
using namespace std;

int main()
{
    int n1,m;

    cin>>n1>>m;

    if(n1>m)
    {
        for(int i=0;i<m;i++)
            cout<<"BG";
        for(int i =0;i<n1-m;i++)
            cout<<"B";

    }
    else
    {
        for(int i=0;i<m;i++)
            cout<<"GB";
        for(int i =0;i<m-n1;i++)
            cout<<"G";

    }

    return 0;
}
        ^


#include<iostream>
using namespace std;

int main()
{
    int n,m;

    cin>>n1>>m;

    if(n1>m)
    {
        for(int i=0;i<m;i++)
            cout<<"BG";
        for(int i =0;i<n1-m;i++)
            cout<<"B";

    }
    else
    {
        for(int i=0;i<m;i++)
            cout<<"GB";
        for(int i =0;i<m-n1;i++)
            cout<<"G";

    }

    return 0;
}


#include<iostream>
using namespace std;

int main()
{
    int n,m;

    cin>>n>>m;

    if(n>m)
    {
        for(int i=0;i<m;i++)
            cout<<"BG";
        for(int i =0;i<n-m;i++)
            cout<<"B";

    }
    else
    {
        for(int i=0;i<m;i++)
            cout<<"GB";
        for(int i =0;i<m-n;i++)
            cout<<"G";

    }

    return 0;
}


#include <stdio.h>

int main()
{
   int n,m,i;
   scanf("%d %d",&n,&m);
    if(n==m)
    {   i=1;
         int sum=n+m;
        while(i<=(sum))
        {
            if(i%2==1) printf("G");
            else printf("B");
        }
    }
   else
   {
       if(n>m)
       {
           for( i=1;i<=2*m;i++)
           if(!(i%2)) printf("G");
           else printf("B");
           for(i=1;i<=n-m;i++)
           printf("B");

       }
       else
       {
           for(i=1;i<=2*n;i++)
           if(i%2) printf("G");
           else printf("B");
           for(i=1;i<=m-n;i++)
           printf("G");
       }
   }
   printf("\n");
   return 0;
  }


#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>

using namespace std;

int main()
{
   int n,m;
   while(cin>>n>>m)
  {
    if(n==m)
   {
   for(int i=1;i<=(n+m);i++)
   if(i%2) printf("B");
   else printf("G");
   }
   else
   {
       if(n>m)
       {
           for(int i=1;i<=2*m;i++)
           if(!i%2) printf("G");
           else printf("B");
           for(int i=1;i<=n-m;i++)
           printf("B");

       }
       else
       {
              for(int i=1;i<=2*n;i++)
           if(i%2) printf("G");
           else printf("B");
           for(int i=1;i<=m-n;i++)
           printf("G");
       }
   }
   printf("\n");
  }
}


#include <stdio.h>

int main()
{
   int n,m,i;
   scanf("%d %d",&n,&m);
    if(n==m)
    {   i=1;
        while(i<=(n+m))
        {
            if(i%2==1) printf("G");
            else printf("B");
        }
    }
   else
   {
       if(n>m)
       {
           for( i=1;i<=2*m;i++)
           if(!(i%2)) printf("G");
           else printf("B");
           for(i=1;i<=n-m;i++)
           printf("B");

       }
       else
       {
           for(i=1;i<=2*n;i++)
           if(i%2) printf("G");
           else printf("B");
           for(i=1;i<=m-n;i++)
           printf("G");
       }
   }
   printf("\n");
   return 0;
  }


#include <stdio.h>
#include <iostream>
using namespace std;
int main()
{
     freopen("input.txt","r",stdin);
     freopen("output.txt","w",stdout);
     int n,m;
     cin>>n>>m;
     if(n==m)
     {
         for(int i=1;i<=n;i++)
         printf("BG");
     }
     else
     {
         if(n>m)
         {
             for(int i=1;i<=m;i++)
             printf("BG");
             for(int i=1;i<=n-m;i++)
             printf("B");
         }
         else
         {
             for(int i=1;i<=n;i++)
             printf("GB");
             for(int i=1;i<=m-n;i++)
             printf("G");
         }
     }
         printf("\n");
}


#include <stdio.h>

int main()
{  freopen("input.txt","r",stdin);
   freopen("output.txt","w",stdout);
   int n,m,i;
   scanf("%d %d",&n,&m);
    if(n==m)
    {   i=1;
         int sum=n+m;
        while(i<=(sum))
        {
            if(i%2==1) printf("G");
            else printf("B");
        }
    }
   else
   {
       if(n>m)
       {
           for( i=1;i<=2*m;i++)
           if(!(i%2)) printf("G");
           else printf("B");
           for(i=1;i<=n-m;i++)
           printf("B");

       }
       else
       {
           for(i=1;i<=2*n;i++)
           if(i%2) printf("G");
           else printf("B");
           for(i=1;i<=m-n;i++)
           printf("G");
       }
   }
   printf("\n");
   return 0;
  }


#include <stdio.h>

int main()
{  //freopen("input.txt","r",stdin);
   //freopen("output.txt","w",stdout);
   int n,m,i;
   scanf("%d %d",&n,&m);
    if(n==m)
    {   i=1;
        // int sum=n+m;
        while(i<=n)
        {
            printf("GB");
            i+=1;
        }
    }
   else
   {
       if(n>m)
       {
           for( i=1;i<=m;i++)
           printf("BG");
           for(i=1;i<=n-m;i++)
           printf("B");

       }
       else
       {
           for(i=1;i<=n;i++)
           printf("GB");
           for(i=1;i<=m-n;i++)
           printf("G");
       }
   }
   printf("\n");
   return 0;
  }


#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>

using namespace std;

int main()
{
   int n,m;
   cin>>n>>m;
   if(n==m)
   {
   for(int i=1;i<=n+m;i++)
   if(i%2) printf("B");
   else printf("G");
   }
   else
   {
       if(n>m)
       {
           for(int i=1;i<=2*m;i++)
           if(!i%2) printf("G");
           else printf("B");
           for(int i=1;i<=n-m;i++)
           printf("B");

       }
       else
       {
              for(int i=1;i<=2*n;i++)
           if(i%2) printf("G");
           else printf("B");
           for(int i=1;i<=m-n;i++)
           printf("G");
       }
   }
   printf("\n");
}


#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>

using namespace std;

int main()
{
   int n,m;
   cin>>n>>m;
   if(n==m)
   for(int i=1;i<=n+m;i++)
   if(i%2) printf("G");
   else printf("B");
   else
   {
       if(n>m)
       {
           for(int i=1;i<=2*m;i++)
           if(!i%2) printf("G");
           else printf("B");
           for(int i=1;i<=n-m;i++)
           printf("B");

       }
       else
       {
              for(int i=1;i<=2*m;i++)
           if(i%2) printf("G");
           else printf("B");
           for(int i=1;i<=n-m;i++)
           printf("G");
       }
   }
   printf("\n");
}


#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>

using namespace std;

int main()
{
   int n,m;
   cin>>n>>m;
   if(n==m)
   {
   for(int i=1;i<=n+m;i++)
   if(i%2) printf("G");
   else printf("B");
   }
   else
   {
       if(n>m)
       {
           for(int i=1;i<=2*m;i++)
           if(!i%2) printf("G");
           else printf("B");
           for(int i=1;i<=n-m;i++)
           printf("B");

       }
       else
       {
              for(int i=1;i<=2*m;i++)
           if(i%2) printf("G");
           else printf("B");
           for(int i=1;i<=n-m;i++)
           printf("G");
       }
   }
   printf("\n");
}


#include <stdio.h>

int main()
{
   int n,m,i;
   scanf("%d %d",&n,&m);
    if(n==m)
   {
   for( i=1;i<=(n+m);i++)
   if(i%2) printf("");
   else printf("G");
   }
   else
   {
       if(n>m)
       {
           for( i=1;i<=2*m;i++)
           if(!(i%2)) printf("G");
           else printf("B");
           for(i=1;i<=n-m;i++)
           printf("B");

       }
       else
       {
           for(i=1;i<=2*n;i++)
           if(i%2) printf("G");
           else printf("B");
           for(i=1;i<=m-n;i++)
           printf("G");
       }
   }
   printf("\n");
   return 0;
  }


#include <stdio.h>
int main()
{printf("GBGBGB\n");
}


#include <stdio.h>
int main()
{int n,m;
scanf("%d %d",&n,&m);
 printf("GBGBGB\n");
 }


#include <stdio.h>

int main()
{  freopen("input.txt","r",stdin);
   freopen("output.txt","w",stdout);
   int n,m,i;
   scanf("%d %d",&n,&m);
    if(n==m)
    {   i=1;
         int sum=n+m;
        while(i<=n)
        {
            printf("GB");
            i+=1;
        }
    }
   else
   {
       if(n>m)
       {
           for( i=1;i<=m;i++)
           printf("BG");
           for(i=1;i<=n-m;i++)
           printf("B");

       }
       else
       {
           for(i=1;i<=n;i++)
           printf("GB");
           for(i=1;i<=m-n;i++)
           printf("G");
       }
   }
   printf("\n");
   return 0;
  }


#include<iostream>

using namespace std ;

int main()
{
int n,m;
while(cin>>n>>m)
{
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
if(n>m)
{
for(int i=0;i<m;i++)
cout<<"BG";
for(int i=0 ;i<((m+n)-2*m);i++)
cout<<"B";
}else{

for(int i=0;i<m;i++)
cout<<"GB";
for(int i=0 ;i<((m+n)-2*m);i++)
cout<<"G";
      }
cout<<endl;
}
}


#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <fstream>
#include <queue>
#include <map>
#include <memory.h>
using namespace std;

#define INF 1000000000

//map<int, vector<int> > m;

int main()
{
    int n,m;
    while(cin>>n>>m)
    {
     if(n>m)
     {
        while(n || m)
        {
            if(n){ cout<<"B"; n--;}
            if(m){ cout<<"G"; m--;}
        }
     }
     else
        while(n || m)
        {
            if(m){ cout<<"G"; m--;}
            if(n){ cout<<"B"; n--;}
        }
        cout<<endl;
    }
    return 0;
}


#include<iostream>

using namespace std ;

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

for(int i=0;i<m;i++)
cout<<"GB";
for(int i=0 ;i<((m+n)-2*m);i++)
cout<<"B";
cout<<endl;

}


#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <fstream>
#include <queue>
#include <map>
#include <memory.h>
using namespace std;

#define INF 1000000000

map<int, vector<int> > m;

int main()
{
    int n,m;
    while(cin>>n>>m)
    {
     if(n>m)
     {
        while(n || m)
        {
            if(n){ cout<<"B"; n--;}
            if(m){ cout<<"G"; m--;}
        }
     }
     else
        while(n || m)
        {
            if(m){ cout<<"G"; m--;}
            if(n){ cout<<"B"; n--;}
        }
        cout<<endl;
    }
    return 0;
}


#include<iostream>
#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <fstream>
#include <queue>
#include <map>
#include <memory.h>
using namespace std ;

int main()
{
int n,m;
while(cin>>n>>m)
{
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
if(n>m)
{
for(int i=0;i<m;i++)
cout<<"BG";
for(int i=0 ;i<((m+n)-2*m);i++)
cout<<"B";
}else{

for(int i=0;i<m;i++)
cout<<"GB";
for(int i=0 ;i<((m+n)-2*m);i++)
cout<<"G";
      }
cout<<endl;
}
}


#include<iostream>

using namespace std ;

int main()
{
int n,m;
while(cin>>n>>m)
{
for(int i=0;i<m;i++)
cout<<"BG";
for(int i=0 ;i<((m+n)-2*m);i++)
cout<<"B";
cout<<endl;
}
}


#include<iostream>
#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <fstream>
#include <queue>
#include <map>
#include <memory.h>
using namespace std ;

int main()
{
int n,m;
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
while(cin>>n>>m)
{

if(n>m)
{
for(int i=0;i<m;i++)
cout<<"BG";
for(int i=0 ;i<((m+n)-2*m);i++)
cout<<"B";
}else{

for(int i=0;i<m;i++)
cout<<"GB";
for(int i=0 ;i<((m+n)-2*m);i++)
cout<<"G";
      }
cout<<endl;
}
}


#include<iostream>
#include<stdio.h>
#include<fstream>
using namespace std;
int main()
{
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
int boy,girl,temp;

     scanf("%d %d",&boy,&girl);

        char a='B',b='G',ch;
        if(girl>boy)
        {
        temp=girl;
        girl=boy;
        boy=temp;
        ch=a;
        a=b;
        b=ch;

        }
          while(boy|girl)
          {
                if(boy) {
                printf("%c",a);
                boy--;
                }
                    if(girl) {
                printf("%c",b);
                girl--;
                }
          }
          printf("\n");

          return 0;

}


#include<iostream>

using namespace std ;

int main()
{
int n,m;
while(cin>>n>>m)
{
for(int i=0;i<m;i++)
cout<<"GB";
for(int i=0 ;i<((m+n)-2*m);i++)
cout<<"B";
cout<<endl;
}
}


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

using namespace std;

int main(int argc, char** argv) {

    int b, g;

    cin >> b >> g;

    while (b || g) {

        if (b) {
            cout << 'B';
            b--;
        }

        if (g) {
            cout << 'G';
            g--;
        }

    }

    return 0;
}


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

using namespace std;

int main(int argc, char** argv) {

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

    int b, g;

    cin >> b >> g;

    char bc = 'B';
    char gc = 'G';

    if (b > g) {
        bc = 'G';
        gc = 'B';

        int tmp = b;
        b = g;
        g = tmp;

    }

    while (b > 0 || g > 0) {

        if (b > 0) {
            cout << bc;
            b--;
        }

        if (g > 0) {
            cout << gc;
            g--;
        }

    }

    cout << endl;

    return 0;
}


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

using namespace std;

int main(int argc, char** argv) {

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

    int b, g;

    cin >> b >> g;

    int b, g;

    cin >> b >> g;

    while (b > 0 || g > 0) {

        if (b > 0) {
            cout << 'B';
            b--;
        }

        if (g > 0) {
            cout << 'G';
            g--;
        }

    }

    cout << endl;

    return 0;
}


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

using namespace std;

int main(int argc, char** argv) {

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

    int b, g;

    cin >> b >> g;

    char bc = 'B';
    char gc = 'G';

    if (b > g) {
        bc = 'G';
        gc = 'B';
    }

    while (b > 0 || g > 0) {

        if (b > 0) {
            cout << bc;
            b--;
        }

        if (g > 0) {
            cout << gc;
            g--;
        }

    }

    cout << endl;

    return 0;
}


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

using namespace std;

int main(int argc, char** argv) {

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

    int b, g;

    cin >> b >> g;

    if (b==g) {

        for(int i=0; i<b;i++) {
            cout << "BG";
        }

    } else if (b > g) {

        for(int i=0; i<g; i++) {
            cout << "BG";
        }

        for(int i=g; i<b;i++) {
            cout << "B";
        }
    } else {

        for(int i=0; i<g; i++) {
            cout << "GB";
        }

        for(int i=g; i<b;i++) {
            cout << "G";
        }
    }

    cout << endl;

    return 0;
}


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

using namespace std;

int main(int argc, char** argv) {

    int b, g;

    cin >> b >> g;

    if (b==g) {

        for(int i=0; i<b;i++) {
            cout << "BG";
        }

    } else if (b > g) {

        for(int i=0; i<g; i++) {
            cout << "BG";
        }

        for(int i=g; i<b;i++) {
            cout << "B";
        }
    } else {

        for(int i=0; i<g; i++) {
            cout << "GB";
        }

        for(int i=g; i<b;i++) {
            cout << "G";
        }
    }

    cout << endl;

    return 0;
}


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

using namespace std;

int main(int argc, char** argv) {

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

    int b, g;

    cin >> b >> g;

    while (b > 0 || g > 0) {

        if (b > 0) {
            cout << 'B';
            b--;
        }

        if (g > 0) {
            cout << 'G';
            g--;
        }

    }

    cout << endl;

    return 0;
}


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

using namespace std;

int main(int argc, char** argv) {

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

    int b, g;

    cin >> b >> g;

    if (b==g) {

        for(int i=0; i<b;i++) {
            cout << "BG";
        }

    } else if (b > g) {

        for(int i=0; i<g; i++) {
            cout << "BG";
        }

        for(int i=g; i<b;i++) {
            cout << "B";
        }
    } else {

        for(int i=0; i<g; i++) {
            cout << "GB";
        }

        for(int i=g; i<b;i++) {
            cout << "G";
        }
    }

    cout << endl;

    return 0;
}


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

using namespace std;

int main(int argc, char** argv) {

    int b, g;

    cin >> b >> g;

    while (b > 0 || g > 0) {

        if (b > 0) {
            cout << 'B';
            b--;
        }

        if (g > 0) {
            cout << 'G';
            g--;
        }

    }

    return 0;
}


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

using namespace std;

int main(int argc, char** argv) {

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

    int b, g;

    cin >> b >> g;

    if (b > g)
        while (b > 0 || g > 0) {

            if (b > 0) {
                cout << 'B';
                b--;
            }

            if (g > 0) {
                cout << 'G';
                g--;
            }
        }
    else
        while (b > 0 || g > 0) {

            if (g > 0) {
                cout << 'G';
                g--;
            }

            if (b > 0) {
                cout << 'B';
                b--;
            }
    }

    cout << endl;

    return 0;
}


#include<iostream>
using namespace std;

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

cin>>n>>m;
cout<<"BGBGBG";

//system("pause");
}


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

using namespace std;

int n,m,a,d[1005],k,l,i,j,b,g;
double res;
string s;main(){

cin>>n>>m;
if(n>m)
{
for(i=0;i<m;i++){
cout<<"BG";
}
n=n-m;
for(i=0;i<n;i++){
cout<<'B';
}
return 0;}

if(n<m)
{
for(i=0;i<n;i++){
cout<<"BG";
}
m=m-n;
for(i=0;i<m;i++){
cout<<'G';
}
return 0;}

if(n==m)
{
for(i=0;i<m;i++){
cout<<"BG";
}
return 0;
}

//system("pause");
}


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

using namespace std;

int n,m,a,d[1005],k,l,i,j,b,g;
double res;
string s;

main(){
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
cin>>n>>m;
if(n==m)
{
for(i=0;i<m;i++){
cout<<"BG";
}
return 0;
}

if(n>m)
{
for(i=0;i<m;i++){
cout<<"GB";
}
n=n-m;
for(i=0;i<n;i++){
cout<<"B";
}
return 0;}

if(n<m)
{
for(i=0;i<n;i++){
cout<<"BG";
}
m=m-n;
for(i=0;i<m;i++){
cout<<"G";
}
return 0;}

//system("pause");
}


#include<iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;

int n,m;
main(){

cin>>n>>m;
cout<<"BGBGBG";

//system("pause");
}


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

int main()
{
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    int n,m,i;
    cin >> n >> m;
    if(n>m){
        for(i=0;i<m;i++) cout << "BG";
        for(;i<n;i++) cout << "B";
    }
    else{
        for(i=0;i<n;i++) cout << "GB";
        for(;i<m;i++) cout << "G";
    }
    return 0;
}


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

using namespace std;

int n,m,a,d[1005],k,l,i,j,b,g;
double res;
string s;main(){

cin>>n>>m;
if(n==m)
{
for(i=0;i<m;i++){
cout<<"BG";
}
return 0;
}

if(n>m)
{
for(i=0;i<m;i++){
cout<<"BG";
}
n=n-m;
for(i=0;i<n;i++){
cout<<'B';
}
return 0;}

if(n<m)
{
for(i=0;i<n;i++){
cout<<"BG";
}
m=m-n;
for(i=0;i<m;i++){
cout<<'G';
}
return 0;}

//system("pause");
}


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

using namespace std;

int n,m,a,d[1005],k,l,i,j,b,g;
double res;
string s;main(){

cin>>n>>m;
if(n>m)
{
for(i=0;i<m;i++){
cout<<"BG";
}
n=n-m;
for(i=0;i<n;i++){
cout<<'B';
}
}

if(n<m)
{
for(i=0;i<n;i++){
cout<<"BG";
}
m=m-n;
for(i=0;i<m;i++){
cout<<'G';
}
}

if(n==m)
{
for(i=0;i<m;i++){
cout<<"BG";
}

}

//system("pause");
}


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

using namespace std;

int n,m,a,d[1005],k,l,i,j,b,g;
double res;
string s;

main(){
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
cin>>n>>m;
if(n==m)
{
for(i=0;i<m;i++){
cout<<"BG";
}
return 0;
}

if(n>m)
{
for(i=0;i<m;i++){
cout<<"BG";
}
n=n-m;
for(i=0;i<n;i++){
cout<<"B";
}
return 0;}

if(n<m)
{
for(i=0;i<n;i++){
cout<<"BG";
}
m=m-n;
for(i=0;i<m;i++){
cout<<"G";
}
return 0;}

//system("pause");
}


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

using namespace std;

int n,m,a,d[1005],k,l,i,j,b,g;
double res;
string s;

main(){
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
cin>>n>>m;
if(n==m)
{
for(i=0;i<m;i++){
cout<<"BG";
}
return 0;
}

if(n>m)
{
for(i=0;i<m;i++){
cout<<"BG";
}
n=n-m;
for(i=0;i<n;i++){
cout<<"B";
}
return 0;}

if(n<m)
{
for(i=0;i<n;i++){
cout<<"GB";
}
m=m-n;
for(i=0;i<m;i++){
cout<<"G";
}
return 0;}

//system("pause");
}


#include<iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;

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

cin>>n>>m;
cout<<"BGBGBG";

//system("pause");
}


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

using namespace std;

int n,m,a,d[1005],k,l,i,j,b,g;
double res;
string s;

main(){

cin>>n>>m;
cout<<"BGBGBG";

//system("pause");
}


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

using namespace std;

int n,m,a,d[1005],k,l,i,j,b,g;
main(){

cin>>n>>m;
if(n>m)
{
for(i=0;i<m;i++){
cout<<"GB";
}
n=n-m;
for(i=0;i<n;i++){
cout<<'B';
}
}

if(n<m)
{
for(i=0;i<n;i++){
cout<<"BG";
}
m=m-n;
for(i=0;i<m;i++){
cout<<'G';
}
}

if(n==m)
{
for(i=0;i<m;i++){
cout<<"BG";
}

}

//system("pause");
}


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

using namespace std;

int n,m,a,d[1005],k,l,i,j,b,g;
double res;
string s;

main(){

cin>>n>>m;
if(n==m)
{
for(i=0;i<m;i++){
cout<<"BG";
}
return 0;
}

if(n>m)
{
for(i=0;i<m;i++){
cout<<"BG";
}
n=n-m;
for(i=0;i<n;i++){
cout<<"B";
}
return 0;}

if(n<m)
{
for(i=0;i<n;i++){
cout<<"BG";
}
m=m-n;
for(i=0;i<m;i++){
cout<<"G";
}
return 0;}

//system("pause");
}


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

using namespace std;

int n,m,a,d[1005],k,l,i,j,b,g;
double res;
string s;main(){

cin>>n>>m;
if(n==m)
{
for(i=0;i<m;i++){
cout<<"BG";
}
return 0;
}

if(n>m)
{
for(i=0;i<m;i++){
cout<<"BG";
}
n=n-m;
for(i=0;i<n;i++){
cout<<"B";
}
return 0;}

if(n<m)
{
for(i=0;i<n;i++){
cout<<"BG";
}
m=m-n;
for(i=0;i<m;i++){
cout<<"G";
}
return 0;}

//system("pause");
}


#include<iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;

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

cin>>n>>m;
cout<<"BGBGBG";
}


#include <bits/stdc++.h>
#define ll long long int
#define mod 1000000007
#define f(i,a,b) for(ll i=a;i<b;i++)
#define rf(i,a,b) for(ll i=a;i>=b;i--)
#define rep(i,n) f(i,0,n)
#define rrep(i,n) rf(i,n-1,0)
#define w(t) ll t; cin>>t; while(t--)
#define vi vector<ll>
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define mii map<ll,ll>
#define mci map<char,ll>
using namespace std;

void fast_IO_file()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

int main()
{
	fast_IO_file();
	ll n, m;
	cin >> n >> m;
	ll tmp = n + m;
	char c = 'G';
	if (m < n)
	{
		c = 'B';
	}
	string ans = "";
	rep(i, tmp)
	{
		ans += c;
		if (c == 'B')
		{
			if (m > 0)
			{
				c = 'G';
			}
			n--;
		}
		else
		{
			if (n > 0)
			{
				c = 'B';
			}
			m--;
		}
	}
	cout << ans;
	return 0;
}


#include <bits/stdc++.h>
#define ll long long int
#define mod 1000000007
#define f(i,a,b) for(ll i=a;i<b;i++)
#define rf(i,a,b) for(ll i=a;i>=b;i--)
#define rep(i,n) f(i,0,n)
#define rrep(i,n) rf(i,n-1,0)
#define w(t) ll t; cin>>t; while(t--)
#define vi vector<ll>
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define mii map<ll,ll>
#define mci map<char,ll>
using namespace std;

void fast_IO_file()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

int main()
{
	fast_IO_file();
	ll n, m;
	cin >> n >> m;
	ll tmp = n + m;
	char c = 'G';
	if (m < n)
	{
		c = 'B';
	}
	rep(i, tmp)
	{
		cout << c;
		if (c == 'B')
		{
			if (m > 0)
			{
				c = 'G';
			}
			n--;
		}
		else
		{
			if (n > 0)
			{
				c = 'B';
			}
			m--;
		}
	}
	// cout << ans;
	return 0;
}


#include <bits/stdc++.h>
#define ll long long int
#define mod 1000000007
#define f(i,a,b) for(ll i=a;i<b;i++)
#define rf(i,a,b) for(ll i=a;i>=b;i--)
#define rep(i,n) f(i,0,n)
#define rrep(i,n) rf(i,n-1,0)
#define w(t) ll t; cin>>t; while(t--)
#define vi vector<ll>
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define mii map<ll,ll>
#define mci map<char,ll>
using namespace std;

void fast_IO_file()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

int main()
{
	fast_IO_file();
	ll n, m;
	cin >> n >> m;
	ll tmp = n + m;
	char c = 'G';
	if (n > m)
	{
		c = 'B';
	}
	while (tmp--)
	{
		cout << c;
		if (c == 'B')
		{
			if (m > 0)
			{
				c = 'G';
			}
			n--;
		}
		else
		{
			if (n > 0)
			{
				c = 'B';
			}
			m--;
		}
	}
	// cout << m << " " << n;
	// cout << ans;
	return 0;
}


#include <bits/stdc++.h>
#define ll long long int
#define mod 1000000007
#define f(i,a,b) for(ll i=a;i<b;i++)
#define rf(i,a,b) for(ll i=a;i>=b;i--)
#define rep(i,n) f(i,0,n)
#define rrep(i,n) rf(i,n-1,0)
#define w(t) ll t; cin>>t; while(t--)
#define vi vector<ll>
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define mii map<ll,ll>
#define mci map<char,ll>
using namespace std;

void fast_IO_file()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
// #ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
// #endif
}

int main()
{
	fast_IO_file();
	ll n, m, cnt = 0;
	cin >> n >> m;
	if (n > m)
	{
		while (n != m)
		{
			cout << "B";
			n--;
		}
		cnt = -1;
	}
	else
	{
		while (n != m)
		{
			cout << "G";
			m--;
		}
		cnt = 1;
	}
	rep(i, n)
	{
		if (cnt == -1)
			cout << "GB";
		else if (cnt == 1)
			cout << "BG";
		// cnt = cnt * (-1);
	}

	return 0;
}


#include <bits/stdc++.h>
#define ll long long int
#define mod 1000000007
#define f(i,a,b) for(ll i=a;i<b;i++)
#define rf(i,a,b) for(ll i=a;i>=b;i--)
#define rep(i,n) f(i,0,n)
#define rrep(i,n) rf(i,n-1,0)
#define w(t) ll t; cin>>t; while(t--)
#define vi vector<ll>
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define mii map<ll,ll>
#define mci map<char,ll>
using namespace std;

void fast_IO_file()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
// #ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
// #endif
}

int main()
{
	fast_IO_file();
	ll n, m;
	cin >> n >> m;
	ll tmp = n + m;
	char c = 'G';
	if (m < n)
	{
		c = 'B';
	}
	string ans = "";
	rep(i, tmp)
	{
		ans += c;
		if (c == 'B')
		{
			if (m > 0)
			{
				c = 'G';
			}
			n--;
		}
		else
		{
			if (n > 0)
			{
				c = 'B';
			}
			m--;
		}
	}
	cout << ans;
	return 0;
}


#include <bits/stdc++.h>
#define ll long long int
#define mod 1000000007
#define f(i,a,b) for(ll i=a;i<b;i++)
#define rf(i,a,b) for(ll i=a;i>=b;i--)
#define rep(i,n) f(i,0,n)
#define rrep(i,n) rf(i,n-1,0)
#define w(t) ll t; cin>>t; while(t--)
#define vi vector<ll>
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define mii map<ll,ll>
#define mci map<char,ll>
using namespace std;

void fast_IO_file()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

int main()
{
	fast_IO_file();
	ll n, m;
	cin >> n >> m;
	ll tmp = n + m;
	string c = "G";
	if (m < n)
	{
		c = "B";
	}
	string ans = "";
	rep(i, tmp)
	{
		ans += c;
		if (c == "B")
		{
			if (m > 0)
			{
				c = "G";
			}
			n--;
		}
		else
		{
			if (n > 0)
			{
				c = "B";
			}
			m--;
		}
	}
	cout << ans;
	return 0;
}


#include <bits/stdc++.h>
#define ll long long int
#define mod 1000000007
#define f(i,a,b) for(ll i=a;i<b;i++)
#define rf(i,a,b) for(ll i=a;i>=b;i--)
#define rep(i,n) f(i,0,n)
#define rrep(i,n) rf(i,n-1,0)
#define w(t) ll t; cin>>t; while(t--)
#define vi vector<ll>
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define mii map<ll,ll>
#define mci map<char,ll>
using namespace std;

void fast_IO_file()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

int main()
{
	fast_IO_file();
	ll n, m;
	cin >> n >> m;
	ll tmp = n + m;
	char c = 'G';
	if (n > m)
	{
		c = 'B';
	}
	rep(i, tmp)
	{
		cout << c;
		if (c == 'B')
		{
			if (m > 0)
			{
				c = 'G';
			}
			n--;
		}
		else
		{
			if (n > 0)
			{
				c = 'B';
			}
			m--;
		}
	}
	// cout << m << " " << n;
	// cout << ans;
	return 0;
}


#include <bits/stdc++.h>
#define ll long long int
#define mod 1000000007
#define f(i,a,b) for(ll i=a;i<b;i++)
#define rf(i,a,b) for(ll i=a;i>=b;i--)
#define rep(i,n) f(i,0,n)
#define rrep(i,n) rf(i,n-1,0)
#define w(t) ll t; cin>>t; while(t--)
#define vi vector<ll>
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define mii map<ll,ll>
#define mci map<char,ll>
using namespace std;

void fast_IO_file()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

int main()
{
	// fast_IO_file();
	ll n, m;
	cin >> n >> m;
	ll tmp = n + m;
	char c = 'G';
	if (n > m)
	{
		c = 'B';
	}

	while (tmp--)
	{
		cout << c;
		if (c == 'B')
		{
			if (m > 0)
			{
				c = 'G';
			}
			n--;
		}
		else
		{
			if (n > 0)
			{
				c = 'B';
			}
			m--;
		}
	}
	// cout << m << " " << n;
	// cout << ans;
	return 0;
}


#include <bits/stdc++.h>
#define ll long long int
#define mod 1000000007
#define f(i,a,b) for(ll i=a;i<b;i++)
#define rf(i,a,b) for(ll i=a;i>=b;i--)
#define rep(i,n) f(i,0,n)
#define rrep(i,n) rf(i,n-1,0)
#define w(t) ll t; cin>>t; while(t--)
#define vi vector<ll>
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define mii map<ll,ll>
#define mci map<char,ll>
using namespace std;

void fast_IO_file()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

int main()
{
	fast_IO_file();
	ll n, m, cnt = 0;
	cin >> n >> m;
	if (n > m)
	{
		while (n != m)
		{
			cout << "B";
			n--;
		}
		cnt = -1;
	}
	else
	{
		while (n != m)
		{
			cout << "G";
			m--;
		}
		cnt = 1;
	}
	rep(i, n)
	{
		if (cnt == -1)
			cout << "GB";
		else if (cnt == 1)
			cout << "BG";
		// cnt = cnt * (-1);
	}

	return 0;
}


//By      :Prajwal Sonawane
//Email   :prajwalsonawane35@gmail.com
//Language:C++
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define digits(x) floor(log10(n) + 1)
#define pn(x) cout << x <<"\n";
#define ps(x) cout << x <<" ";
#define deb(x) cout << #x << "=" << x << endl;
#define test unsigned int t;cin >> t;while(t--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;

int main(void)
{
    fastio
    int n,m;
    cin>>n>>m;

    if(n>m)
    {
        for(int i=1; i<=m; i++)
        {
            cout<<"BG";
        }

        for(int i=1;i<=n-m; i++){
            cout<<"B";}
    }
    else
    {
        for(int i=1; i<=n; i++)
        {
            cout<<"GB";
        }
        for(int i=1;i<=m-n; i++){
            cout<<"G";}
    }
    return 0;
}


//By      :Prajwal Sonawane
//Email   :prajwalsonawane35@gmail.com
//Language:C++
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define digits(x) floor(log10(n) + 1)
#define pn(x) cout << x <<"\n";
#define ps(x) cout << x <<" ";
#define deb(x) cout << #x << "=" << x << endl;
#define test unsigned int t;cin >> t;while(t--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;

int main(void)
{
    fastio
    int n,m;

    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    cin>>n>>m;

    if(n>m)
    {
        for(int i=1; i<=m; i++)
        {
            cout<<"BG";
        }

        for(int i=1;i<=n-m; i++){
            cout<<"B";}
    }
    else
    {
        for(int i=1; i<=n; i++)
        {
            cout<<"GB";
        }
        for(int i=1;i<=m-n; i++){
            cout<<"G";}
    }
    return 0;
}


//By      :Prajwal Sonawane
//Email   :prajwalsonawane35@gmail.com
//Language:C++
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define digits(x) floor(log10(n) + 1)
#define pn(x) cout << x <<"\n";
#define ps(x) cout << x <<" ";
#define deb(x) cout << #x << "=" << x << endl;
#define test unsigned int t;cin >> t;while(t--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;

int main(void)
{
    fastio
    int n,m;
    cin>>n>>m;

    return 0;
}


//By      :Prajwal Sonawane
//Email   :prajwalsonawane35@gmail.com
//Language:C++
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define digits(x) floor(log10(n) + 1)
#define pn(x) cout << x <<"\n";
#define ps(x) cout << x <<" ";
#define deb(x) cout << #x << "=" << x << endl;
#define test unsigned int t;cin >> t;while(t--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;

int main(void)
{
    fastio
    int n,m;
    cin>>n>>m;
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    if(n>m)
    {
        for(int i=1; i<=m; i++)
        {
            cout<<"BG";
        }

        for(int i=1;i<=n-m; i++){
            cout<<"B";}
    }
    else
    {
        for(int i=1; i<=n; i++)
        {
            cout<<"GB";
        }
        for(int i=1;i<=m-n; i++){
            cout<<"G";}
    }
    return 0;
}


      #include<iostream>
        #include<bits/stdc++.h>
        #define ll long long
        using namespace std;
        int main()
        {
                            ios_base::sync_with_stdio(false);
                            cin.tie(0);
                            cout.tie(0);
                   int n,m;
   		cin >> n >> m;
		if (n < m){
			for (int i = 0; i < n; i++)
				cout << "GB";
		       	m -= n;
		       	for (int i = 0; i < m; i++)
		       		cout << "G";
		}
		else{
			for (int i = 0; i < m; i++)
				cout << "BG";
		       	n -= m;
		       	for (int i = 0; i < n; i++)
		       		cout << "B";
		}

	return 0;

        }


      #include<iostream>
        #include<bits/stdc++.h>
        #define ll long long
        using namespace std;
        int main()
        {
                          	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);

		cin >> n >> m;
		if (n < m){
			for (int i = 0; i < n; i++)
				cout << "GB";
		       	m -= n;
		       	for (int i = 0; i < m; i++)
		       		cout << "G";
		}
		else{
			for (int i = 0; i < m; i++)
				cout << "BG";
		       	n -= m;
		       	for (int i = 0; i < n; i++)
		       		cout << "B";
		}
	return 0;

        }


      #include<iostream>
        #include<bits/stdc++.h>
        #define ll long long
        using namespace std;
        int main()
        {
                      /*      ios_base::sync_with_stdio(false);
                            cin.tie(0);
                            cout.tie(0);*/
                            	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);

    ll i,j;
    cin>>i>>j;
    if(i<=j)
    {
    while(i!=0||j!=0)
    {
        if(i!=0)
        {
               cout<<"G";
               i--;
        }
        if(j!=0)
        {
               cout<<"B";
               j--;
        }
    }
    }
    else
    {
           while(i!=0||j!=0)
           {

                  if(i!=0)
                  {
                         cout<<"B";
                         j--;
                  }
                  if(j!=0)
                  {
                         cout<<"G";
                         i--;
                  }
           }
    }

	return 0;

        }


      #include<iostream>
        #include<bits/stdc++.h>
        #define ll long long
        using namespace std;
        int main()
        {
                          	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
       int n,m;
		cin >> n >> m;
		if (n < m){
			for (int i = 0; i < n; i++)
				cout << "GB";
		       	m -= n;
		       	for (int i = 0; i < m; i++)
		       		cout << "G";
		}
		else{
			for (int i = 0; i < m; i++)
				cout << "BG";
		       	n -= m;
		       	for (int i = 0; i < n; i++)
		       		cout << "B";
		}
	return 0;

        }


      #include<iostream>
        #include<bits/stdc++.h>
        #define ll long long
        using namespace std;
        int main()
        {
                      /*      ios_base::sync_with_stdio(false);
                            cin.tie(0);
                            cout.tie(0);*/
                            	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);

    ll i,j;
    cin>>i>>j;
    if(i<=j)
    {
    while(i!=0||j!=0)
    {
        if(i!=0)
        {
               cout<<"G";
               i--;
        }
        if(j!=0)
        {
               cout<<"B";
               j--;
        }
    }
    }
    else
    {
           while(i!=0||j!=0)
           {

                  if(j!=0)
                  {
                         cout<<"B";
                         j--;
                  }
                  if(i!=0)
                  {
                         cout<<"G";
                         i--;
                  }
           }
    }

	return 0;

        }


      #include<iostream>
        #include<bits/stdc++.h>
        #define ll long long
        using namespace std;
        int main()
        {
                      /*      ios_base::sync_with_stdio(false);
                            cin.tie(0);
                            cout.tie(0);*/
                            	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);

    ll i,j;
    cin>>i>>j;
    if(i<=j)
    {
    while(i!=0||j!=0)
    {
        if(j!=0)
        {
               cout<<"G";
               i--;
        }
        if(i!=0)
        {
               cout<<"B";
               j--;
        }
    }
    }
    else
    {
           while(i!=0||j!=0)
           {

                  if(i!=0)
                  {
                         cout<<"B";
                         i--;
                  }
                  if(j!=0)
                  {
                         cout<<"G";
                         j--;
                  }
           }
    }

	return 0;

        }


      #include<iostream>
        #include<bits/stdc++.h>
        #define ll long long
        using namespace std;
        int main()
        {
                            ios_base::sync_with_stdio(false);
                            cin.tie(0);
                            cout.tie(0);
    ll i,j;
    cin>>i>>j;
    if(i<=j)
    {
    while(i!=0||j!=0)
    {
        if(i!=0)
        {
               cout<<"G";
               i--;
        }
        if(j!=0)
        {
               cout<<"B";
               j--;
        }
    }
    }
    else
    {
           while(i!=0||j!=0)
           {

                  if(j!=0)
                  {
                         cout<<"B";
                         j--;
                  }
                  if(i!=0)
                  {
                         cout<<"G";
                         i--;
                  }
           }
    }

	return 0;

        }


      #include<iostream>
        #include<bits/stdc++.h>
        #define ll long long
        using namespace std;
        int main()
        {
                      /*      ios_base::sync_with_stdio(false);
                            cin.tie(0);
                            cout.tie(0);*/
                            	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);

    ll i,j;
    cin>>i>>j;
    if(i<=j)
    {
    while(i!=0||j!=0)
    {
        if(j!=0)
        {
               cout<<"G";
               j--;
        }
        if(i!=0)
        {
               cout<<"B";
               i--;
        }
    }
    }
    else
    {
           while(i!=0||j!=0)
           {

                  if(i!=0)
                  {
                         cout<<"B";
                         i--;
                  }
                  if(j!=0)
                  {
                         cout<<"G";
                         j--;
                  }
           }
    }

	return 0;

        }


#include <iostream>
#include<fstream>
#include<bits/stdc++.h>
using namespace std;
int main(){
int Boys,Girls,n;
string s="";
ifstream in("input.txt");
ofstream out("output.txt");
in>>Boys>>Girls;
n=Boys+Girls;
for(int y=1;y<=n;y++){
    if(Boys>0){
    s+="B";
       Boys--;
    }
    if(Girls>0){
    s+="G";
        Girls--;
    }

}
out<<s;

return 0;}


#include <iostream>
#include<bits/stdc++.h>
using namespace std;
int main(){
int Boys,Girls,n;
string s="";
cin>>Boys>>Girls;
n=Boys+Girls;
for(int y=1;y<=n;y++){
    if(Boys>0){
    s+="B";
       Boys--;
    }
    if(Girls>0){
    s+="G";
        Girls--;
    }

}
cout<<s<<endl;

return 0;}


#include <iostream>
#include<fstream>
#include<bits/stdc++.h>
using namespace std;
int main(){
int Boys,Girls,n=0;
ifstream in("input.txt");
ofstream out("output.txt");
in>>Boys>>Girls;
Boys>Girls?n=Boys:n=Girls;
for(int y=1;y<=n;y++){

    if(Boys>0){
    out<<"B";
       Boys--;
    }
    if(Girls>0){
    out<<"G";
        Girls--;
    }
}

return 0;
}


#include <iostream>
#include<fstream>
#include<bits/stdc++.h>
using namespace std;
int main(){
int Boys,Girls,n=0;
ifstream in("input.txt");
ofstream out("output.txt");
in>>Boys>>Girls;
n=Boys+Girls;
for(int y=1;y<=n;y++){

    if(Boys>Girls){
    out<<"B";
       Boys--;
    }
else {
      if(Girls>0){
    out<<"G";
        Girls--;
    }
    if(Boys>0){
        out<<"B";
        Boys--;
    }
    }
}

return 0;
}


#include <iostream>
#include<fstream>
#include<bits/stdc++.h>
using namespace std;
int main(){
int Boys,Girls,n;
ifstream in("input.txt");
ofstream out("output.txt");
in>>Boys>>Girls;
n=Boys+Girls;
for(int y=1;y<=n;y++){
    if(Boys>0){
    out<<"B";
       Boys--;
    }
    if(Girls>0){
    out<<"G";
        Girls--;
    }

}

return 0;}


#include <iostream>
#include<fstream>
#include<bits/stdc++.h>
using namespace std;
int main(){
int Boys,Girls,n=0,k=0,o=0;
ifstream in("input.txt");
ofstream out("output.txt");
in>>Boys>>Girls;
n=Boys+Girls;
//Boys>Girls?n=Boys:n=Girls;
for(int y=1;y<=n;y++){

    if(Boys>0){
    out<<"B";
    ++k;
       Boys--;
    }
    if(Girls>0){
    out<<"G";
    ++o;
        Girls--;
    }
    if(o+k==n){
        break;
    }
}

return 0;
}


#include <iostream>
#include<bits/stdc++.h>
using namespace std;
int main(){
int Boys,Girls,n;
cin>>Boys>>Girls;
n=Boys+Girls;
for(int y=1;y<=n;y++){
    if(Boys>0){
        cout<<"B";
       Boys--;
    }
    if(Girls>0){
        cout<<"G";
        Girls--;
    }

}
cout<<endl;

return 0;}


#include<bits/stdc++.h>
#include <string>
using namespace std;
int main()
{
 int n,m;
 scanf("%d %d",&n ,&m);
 if(n>=m)
 {
     for(int i=0;i<m;i++)
     {
         printf("BG");

     }
     for(int i=0;i<n-m;i++)
     {
         printf("B");

     }

 }
 else if(n<m)
 {
     for(int i=0;i<n;i++)
     {
         printf("GB");

     }
     for(int i=0;i<m-n;i++)
     {
         printf("G");

     }

 }
 return 0 ;

}


#include<bits/stdc++.h>
#include <string>
using namespace std;
int main()
{
 int n,m;
 string s;
 cin>>n>>m;
 if(n>=m)
 {
     for(int i=0;i<m;i++)
     {
         s.push_back('B');;s.push_back('G');
     }
     for(int i=0;i<n-m;i++)
     {
        s.push_back('B');
     }

 }
 else if(n<m)
 {
     for(int i=0;i<n;i++)
     {
         s.push_back('G');s.push_back('B');
     }
     for(int i=0;i<m-n;i++)
     {
         s.push_back('G');

     }

 }
 cout<<s;


#include<bits/stdc++.h>
#include <string>
using namespace std;
int main()
{
 int n,m;
 cin>>n>>m;
 if(n>=m)
 {
     for(int i=0;i<2*m;i++)
     {
         if(i%2==0)cout<<"B";
         else cout<<"G";
     }
     for(int i=0;i<n-m;i++)
     {
         cout<<"B";

     }
     return 0;
 }
 else if(n<m)
 {
     for(int i=0;i<2*n;i++)
     {
         if(i%2==0)cout<<"G";
         else cout<<"B";
     }
     for(int i=0;i<m-n;i++)
     {
         cout<<"G";

     }
     return 0;
 }

}


#include<bits/stdc++.h>
#include<stdio.h>
#include <string>
using namespace std;
int main()
{
freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
 int n,m;
 cin>>n>>m;
 if(n>=m)
 {
     for(int i=0;i<m;i++)
     {
         cout<<"BG";

     }
     for(int i=0;i<n-m;i++)
     {
         cout<<"B";

     }

 }
 else if(n<m)
 {
     for(int i=0;i<n;i++)
     {
         cout<<"GB";

     }
     for(int i=0;i<m-n;i++)
     {
         cout<<"G";

     }

 }
 return 0;

}


#include<bits/stdc++.h>
#include <string>
using namespace std;
int main()
{
 int n,m;
 scanf("%d %d",&n ,&m)
 if(n>=m)
 {
     for(int i=0;i<m;i++)
     {
         printf("BG");

     }
     for(int i=0;i<n-m;i++)
     {
         printf("B");

     }

 }
 else if(n<m)
 {
     for(int i=0;i<n;i++)
     {
         printf("GB");

     }
     for(int i=0;i<m-n;i++)
     {
         printf("G");

     }

 }
 return 0;

}


#include<bits/stdc++.h>
#include <string>
using namespace std;
int main()
{
 int n,m;
 scanf("%d %d",&n ,&m);
 if(n>=m)
 {
     for(int i=0;i<m;i++)
     {
         printf("BG");

     }
     for(int i=0;i<n-m;i++)
     {
         printf("B");

     }

 }
 else if(n<m)
 {
     for(int i=0;i<n;i++)
     {
         printf("GB");

     }
     for(int i=0;i<m-n;i++)
     {
         printf("G");

     }

 }
 return 0;

}


#include<iostream>
#include <string>
using namespace std;
int main()
{
 int n,m;
 cin>>n>>m;
 if(n>=m)
 {
     for(int i=0;i<2*m;i++)
     {
         if(i%2==0)cout<<"B";
         else cout<<"G";
     }
     for(int i=0;i<n-m;i++)
     {
         cout<<"B";

     }
     return 0;
 }
 else if(n<m)
 {
     for(int i=0;i<2*n;i++)
     {
         if(i%2==0)cout<<"G";
         else cout<<"B";
     }
     for(int i=0;i<m-n;i++)
     {
         cout<<"G";

     }
     return 0;
 }

}


#include<bits/stdc++.h>
#include <string>
using namespace std;
int main()
{
 int n,m;
 cin>>n>>m;
 if(n>=m)
 {
     for(int i=0;i<m;i++)
     {
         cout<<"B";cout<<"G";
     }
     for(int i=0;i<n-m;i++)
     {
         cout<<"B";

     }
     return 0;
 }
 else if(n<m)
 {
     for(int i=0;i<n;i++)
     {
         cout<<"G";cout<<"B";
     }
     for(int i=0;i<m-n;i++)
     {
         cout<<"G";

     }
     return 0;
 }

}


#include<bits/stdc++.h>
#include <string>
using namespace std;
int main()
{
 int n,m;
 cin>>n>>m;
 if(n>=m)
 {
     for(int i=0;i<m;i++)
     {
         cout<<"BG";

     }
     for(int i=0;i<n-m;i++)
     {
         cout<<"B";

     }

 }
 else if(n<m)
 {
     for(int i=0;i<n;i++)
     {
         cout<<"GB";

     }
     for(int i=0;i<m-n;i++)
     {
         cout<<"G";

     }

 }
 return 0;

}


#include<bits/stdc++.h>
#include <string>
using namespace std;
int main()
{
 int n,m;
 string s;
 cin>>n>>m;
 if(n>=m)
 {
     for(int i=0;i<m;i++)
     {
         s.push_back('B');;s.push_back('G');
     }
     for(int i=0;i<n-m;i++)
     {
        s.push_back('B');
     }

 }
 else if(n<m)
 {
     for(int i=0;i<n;i++)
     {
         s.push_back('G');s.push_back('B');
     }
     for(int i=0;i<m-n;i++)
     {
         s.push_back('G');

     }

 }
 cout<<s;
}


#include<bits/stdc++.h>
#include <string>
using namespace std;
int main()
{
 int n,m;
 string s;
 cin>>n>>m;
 if(n>=m)
 {
     for(int i=0;i<m;i++)
     {
         s.push_back('B');;s.push_back('G');
     }
     for(int i=0;i<n-m;i++)
     {
        s.push_back('B');
     }

 }
 else if(n<m)
 {
     for(int i=0;i<n;i++)
     {
         s.push_back('G');s.push_back('B');
     }
     for(int i=0;i<m-n;i++)
     {
         s.push_back('G');

     }

 }
 cout<<s;

}


#include<bits/stdc++.h>
#define ll long long int
#include <stdlib.h>
#include <vector>
#define pi acos(-1)
#define pb push_back
#define MOD 1e9+7
#define highest(x) numeric_limits<x>::max()
#define lowest(x) numeric_limits<x>::min()
///s1.substr(1,3);///STARTING FROM INDEX 1, 3 LNEGTH SUBSTRING.
///s1.find("adn")///RETURNS STARTING INDEX OF THE SUBSTRING
///"adn" IF IT EXISTS IN THE STRING S1.///
///s1.find("adn",int pos);///RETURNS STARTING INDEX OF THE
///SUBSTRING "adn" SEARCHING FROM INDEX POS OF STRING s1.///
///string::npos returns a garbage value if not found...
///reverse(s1.begin(),s1.end())-> to reverse a string.
///next_permutation(f,f+n)->f array er next permutation return korbe..
///str.erase(1,2)->deletes 2 char from index 1..
///for(auto i:p2)->i=p2.begin() theke p2.end() er ag porjonto..
///max_element(v,v+4);->return a pointer to the max element
///in a array/vector.. v from 1st element to 4th element.
///same for min_element(v,v+4);
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define gcd(a,b) __gcd(a,b)
using namespace std;

//vector<int>prime(8000000,0);
vector<bool>mark(100000000,false);
int prime[8000000];
int nprime;

void sieve(int n)
{
    int limit=sqrt(n*1.0)+1,s=0;nprime=0;
    mark[1]=true;///1 if not prime.
    mark[2]=false;prime[nprime++]=2;//cout<<2<<endl;
    for(int i=4;i<=n;i+=2)mark[i]=true;
    for(int i=3;i<=n;i+=2){
        if(!mark[i]){prime[nprime++]=i;//cout<<i<<endl;
        if(i<=limit){///karon limit er upor theke n porjonto not prime gula already cuta hoise.
            for(int j=i*i;j<=n;j+=i*2){
                mark[j]=true;
            }
          }
        }
    }
    //puts("2");
    //cout<<nprime<<endl;
    for(int i=1;i<=nprime;i+=100)cout<<prime[i-1]<<endl;
    //return nprime;
}
ll l1[200005],l2[100005],vis[100005],s=0,m;
ll dx[]={1,0,-1,0};
ll dy[]={0,-1,0,1};

ll arr[200005];
ll tree[200005];

void update(ll idx,ll val,ll n)
{
    while(idx<=n){
        tree[idx]+=val;
        idx+=(idx & -idx);
    }
}

int read(ll idx)
{
    ll sum=0;
    while(idx>0){
        sum+=tree[idx];
        idx-=(idx & -idx);
    }
    return sum;
}

vector<ll>v[5];
set<ll>v2;
map<ll,ll>m2;
vector<pair<ll,ll>>p2;

//void dfs(int a)
//{
//    if(vis[a])return;
//    vis[a]=1;
//    if(!v[a].size()){s++;return;}
//    for(int i=0;i<v[a].size();i++){
//        if(!vis[v[a][i]]&&l1[a]+l1[v[a][i]]<=m)dfs(v[a][i]);
//    }
//    //cout<<s<<endl;
//}

int main()
{
    //freopen("input.in", "r", stdin);
    //freopen("output.out", "w", stdout);
    ll t,i,q,n,m,k,l,c,d,p,nl,np,a,e=1,b,x2=-1,x1=1000000005,x3=0,x4=0,x5=0,x6=0,x8=0;
    double x10=0;char x11;int x12=0;
    string s2,s3="",s4,s5,s6,s7;
    queue<ll>q2;
    cin>>n>>m;
    //for(int i=0;i<n+m;i++)s3+='B';
    for(int i=0;i<n+m;i++){
        if(i&1 && e<=m)cout<<"G";
        else cout<<"B";
        e++;
    }

    return 0;
}


#include<bits/stdc++.h>
#define ll long long int
#include <stdlib.h>
#include <vector>
#define pi acos(-1)
#define pb push_back
#define MOD 1e9+7
#define highest(x) numeric_limits<x>::max()
#define lowest(x) numeric_limits<x>::min()
///s1.substr(1,3);///STARTING FROM INDEX 1, 3 LNEGTH SUBSTRING.
///s1.find("adn")///RETURNS STARTING INDEX OF THE SUBSTRING
///"adn" IF IT EXISTS IN THE STRING S1.///
///s1.find("adn",int pos);///RETURNS STARTING INDEX OF THE
///SUBSTRING "adn" SEARCHING FROM INDEX POS OF STRING s1.///
///string::npos returns a garbage value if not found...
///reverse(s1.begin(),s1.end())-> to reverse a string.
///next_permutation(f,f+n)->f array er next permutation return korbe..
///str.erase(1,2)->deletes 2 char from index 1..
///for(auto i:p2)->i=p2.begin() theke p2.end() er ag porjonto..
///max_element(v,v+4);->return a pointer to the max element
///in a array/vector.. v from 1st element to 4th element.
///same for min_element(v,v+4);
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define gcd(a,b) __gcd(a,b)
using namespace std;

//vector<int>prime(8000000,0);
vector<bool>mark(100000000,false);
int prime[8000000];
int nprime;

void sieve(int n)
{
    int limit=sqrt(n*1.0)+1,s=0;nprime=0;
    mark[1]=true;///1 if not prime.
    mark[2]=false;prime[nprime++]=2;//cout<<2<<endl;
    for(int i=4;i<=n;i+=2)mark[i]=true;
    for(int i=3;i<=n;i+=2){
        if(!mark[i]){prime[nprime++]=i;//cout<<i<<endl;
        if(i<=limit){///karon limit er upor theke n porjonto not prime gula already cuta hoise.
            for(int j=i*i;j<=n;j+=i*2){
                mark[j]=true;
            }
          }
        }
    }
    //puts("2");
    //cout<<nprime<<endl;
    for(int i=1;i<=nprime;i+=100)cout<<prime[i-1]<<endl;
    //return nprime;
}
ll l1[200005],l2[100005],vis[100005],s=0,m;
ll dx[]={1,0,-1,0};
ll dy[]={0,-1,0,1};

ll arr[200005];
ll tree[200005];

void update(ll idx,ll val,ll n)
{
    while(idx<=n){
        tree[idx]+=val;
        idx+=(idx & -idx);
    }
}

int read(ll idx)
{
    ll sum=0;
    while(idx>0){
        sum+=tree[idx];
        idx-=(idx & -idx);
    }
    return sum;
}

vector<ll>v[5];
set<ll>v2;
map<ll,ll>m2;
vector<pair<ll,ll>>p2;

//void dfs(int a)
//{
//    if(vis[a])return;
//    vis[a]=1;
//    if(!v[a].size()){s++;return;}
//    for(int i=0;i<v[a].size();i++){
//        if(!vis[v[a][i]]&&l1[a]+l1[v[a][i]]<=m)dfs(v[a][i]);
//    }
//    //cout<<s<<endl;
//}

int main()
{
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    ll t,i,q,n,m,k,l,c,d,p,nl,np,a,e=1,b,x2=-1,x1=1000000005,x3=0,x4=0,x5=0,x6=0,x8=0;
    double x10=0;char x11;int x12=0;
    string s2,s3="",s4,s5,s6,s7;
    queue<ll>q2;
    cin>>n>>m;//n-=1;m-=2;
    //cout<<n<<m<<endl;
    if(n>m){
    for(int i=0;i<n+m;i++){
        if((i&1) && e<=m){cout<<"G";e++;}
        else cout<<"B";
        //cout<<i<<" "<<e<<" "<<m<<endl;
    }}
    else{
       for(int i=0;i<n+m;i++){
        if((i&1) && e<=n){cout<<"B";e++;}
        else cout<<"G";
        //cout<<i<<" "<<e<<" "<<m<<endl;
    }
    }

    return 0;
}


#include<bits/stdc++.h>
#define ll long long int
#include <stdlib.h>
#include <vector>
#define pi acos(-1)
#define pb push_back
#define MOD 1e9+7
#define highest(x) numeric_limits<x>::max()
#define lowest(x) numeric_limits<x>::min()
///s1.substr(1,3);///STARTING FROM INDEX 1, 3 LNEGTH SUBSTRING.
///s1.find("adn")///RETURNS STARTING INDEX OF THE SUBSTRING
///"adn" IF IT EXISTS IN THE STRING S1.///
///s1.find("adn",int pos);///RETURNS STARTING INDEX OF THE
///SUBSTRING "adn" SEARCHING FROM INDEX POS OF STRING s1.///
///string::npos returns a garbage value if not found...
///reverse(s1.begin(),s1.end())-> to reverse a string.
///next_permutation(f,f+n)->f array er next permutation return korbe..
///str.erase(1,2)->deletes 2 char from index 1..
///for(auto i:p2)->i=p2.begin() theke p2.end() er ag porjonto..
///max_element(v,v+4);->return a pointer to the max element
///in a array/vector.. v from 1st element to 4th element.
///same for min_element(v,v+4);
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define gcd(a,b) __gcd(a,b)
using namespace std;

//vector<int>prime(8000000,0);
vector<bool>mark(100000000,false);
int prime[8000000];
int nprime;

void sieve(int n)
{
    int limit=sqrt(n*1.0)+1,s=0;nprime=0;
    mark[1]=true;///1 if not prime.
    mark[2]=false;prime[nprime++]=2;//cout<<2<<endl;
    for(int i=4;i<=n;i+=2)mark[i]=true;
    for(int i=3;i<=n;i+=2){
        if(!mark[i]){prime[nprime++]=i;//cout<<i<<endl;
        if(i<=limit){///karon limit er upor theke n porjonto not prime gula already cuta hoise.
            for(int j=i*i;j<=n;j+=i*2){
                mark[j]=true;
            }
          }
        }
    }
    //puts("2");
    //cout<<nprime<<endl;
    for(int i=1;i<=nprime;i+=100)cout<<prime[i-1]<<endl;
    //return nprime;
}
ll l1[200005],l2[100005],vis[100005],s=0,m;
ll dx[]={1,0,-1,0};
ll dy[]={0,-1,0,1};

ll arr[200005];
ll tree[200005];

void update(ll idx,ll val,ll n)
{
    while(idx<=n){
        tree[idx]+=val;
        idx+=(idx & -idx);
    }
}

int read(ll idx)
{
    ll sum=0;
    while(idx>0){
        sum+=tree[idx];
        idx-=(idx & -idx);
    }
    return sum;
}

vector<ll>v[5];
set<ll>v2;
map<ll,ll>m2;
vector<pair<ll,ll>>p2;

//void dfs(int a)
//{
//    if(vis[a])return;
//    vis[a]=1;
//    if(!v[a].size()){s++;return;}
//    for(int i=0;i<v[a].size();i++){
//        if(!vis[v[a][i]]&&l1[a]+l1[v[a][i]]<=m)dfs(v[a][i]);
//    }
//    //cout<<s<<endl;
//}

int main()
{
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    ll t,i,q,n,m,k,l,c,d,p,nl,np,a,e=1,b,x2=-1,x1=1000000005,x3=0,x4=0,x5=0,x6=0,x8=0;
    double x10=0;char x11;int x12=0;
    string s2,s3="",s4,s5,s6,s7;
    queue<ll>q2;
    cin>>n>>m;//n-=1;m-=2;
    //cout<<n<<m<<endl;
    for(int i=0;i<n+m;i++){
        if((i&1) && e<=m){cout<<"G";e++;}
        else cout<<"B";
        //cout<<i<<" "<<e<<" "<<m<<endl;
    }

    return 0;
}


#include<bits/stdc++.h>
#define ll long long int
#include <stdlib.h>
#include <vector>
#define pi acos(-1)
#define pb push_back
#define MOD 1e9+7
#define highest(x) numeric_limits<x>::max()
#define lowest(x) numeric_limits<x>::min()
///s1.substr(1,3);///STARTING FROM INDEX 1, 3 LNEGTH SUBSTRING.
///s1.find("adn")///RETURNS STARTING INDEX OF THE SUBSTRING
///"adn" IF IT EXISTS IN THE STRING S1.///
///s1.find("adn",int pos);///RETURNS STARTING INDEX OF THE
///SUBSTRING "adn" SEARCHING FROM INDEX POS OF STRING s1.///
///string::npos returns a garbage value if not found...
///reverse(s1.begin(),s1.end())-> to reverse a string.
///next_permutation(f,f+n)->f array er next permutation return korbe..
///str.erase(1,2)->deletes 2 char from index 1..
///for(auto i:p2)->i=p2.begin() theke p2.end() er ag porjonto..
///max_element(v,v+4);->return a pointer to the max element
///in a array/vector.. v from 1st element to 4th element.
///same for min_element(v,v+4);
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define gcd(a,b) __gcd(a,b)
using namespace std;

//vector<int>prime(8000000,0);
vector<bool>mark(100000000,false);
int prime[8000000];
int nprime;

void sieve(int n)
{
    int limit=sqrt(n*1.0)+1,s=0;nprime=0;
    mark[1]=true;///1 if not prime.
    mark[2]=false;prime[nprime++]=2;//cout<<2<<endl;
    for(int i=4;i<=n;i+=2)mark[i]=true;
    for(int i=3;i<=n;i+=2){
        if(!mark[i]){prime[nprime++]=i;//cout<<i<<endl;
        if(i<=limit){///karon limit er upor theke n porjonto not prime gula already cuta hoise.
            for(int j=i*i;j<=n;j+=i*2){
                mark[j]=true;
            }
          }
        }
    }
    //puts("2");
    //cout<<nprime<<endl;
    for(int i=1;i<=nprime;i+=100)cout<<prime[i-1]<<endl;
    //return nprime;
}
ll l1[200005],l2[100005],vis[100005],s=0,m;
ll dx[]={1,0,-1,0};
ll dy[]={0,-1,0,1};

ll arr[200005];
ll tree[200005];

void update(ll idx,ll val,ll n)
{
    while(idx<=n){
        tree[idx]+=val;
        idx+=(idx & -idx);
    }
}

int read(ll idx)
{
    ll sum=0;
    while(idx>0){
        sum+=tree[idx];
        idx-=(idx & -idx);
    }
    return sum;
}

vector<ll>v[5];
set<ll>v2;
map<ll,ll>m2;
vector<pair<ll,ll>>p2;

//void dfs(int a)
//{
//    if(vis[a])return;
//    vis[a]=1;
//    if(!v[a].size()){s++;return;}
//    for(int i=0;i<v[a].size();i++){
//        if(!vis[v[a][i]]&&l1[a]+l1[v[a][i]]<=m)dfs(v[a][i]);
//    }
//    //cout<<s<<endl;
//}

int main()
{
    freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ll t,i,q,n,m,k,l,c,d,p,nl,np,a,e=1,b,x2=-1,x1=1000000005,x3=0,x4=0,x5=0,x6=0,x8=0;
    double x10=0;char x11;int x12=0;
    string s2,s3="",s4,s5,s6,s7;
    queue<ll>q2;
    cin>>n>>m;//n-=1;m-=2;
    //cout<<n<<m<<endl;
    for(int i=0;i<n+m;i++){
        if((i&1) && e<=m){cout<<"G";e++;}
        else cout<<"B";
        //cout<<i<<" "<<e<<" "<<m<<endl;
    }

    return 0;
}


import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import static java.lang.Math.*;

/*
 *
 * https://codeforces.com/contest/1405/problem/D
 *
 * Something wrong in this answer
 * Couldn't figure out what it was
 *
 *
 */
public class D {
	public static void main(String[] args) throws Exception {
		new D().go();
	}

	int USE_FILE = 0;
	String INPUT = "4\r\n" +
			"4 3 2 1 2\r\n" +
			"1 2\r\n" +
			"1 3\r\n" +
			"1 4\r\n" +
			"6 6 1 2 5\r\n" +
			"1 2\r\n" +
			"6 5\r\n" +
			"2 3\r\n" +
			"3 4\r\n" +
			"4 5\r\n" +
			"9 3 9 2 5\r\n" +
			"1 2\r\n" +
			"1 6\r\n" +
			"1 9\r\n" +
			"1 3\r\n" +
			"9 5\r\n" +
			"7 9\r\n" +
			"4 8\r\n" +
			"4 3\r\n" +
			"11 8 11 3 3\r\n" +
			"1 2\r\n" +
			"11 9\r\n" +
			"4 9\r\n" +
			"6 5\r\n" +
			"2 10\r\n" +
			"3 2\r\n" +
			"5 9\r\n" +
			"8 3\r\n" +
			"7 4\r\n" +
			"7 10";

	void solve(int caseNr) {
		int n = in.nextInt();
		int a = in.nextInt();
		int b = in.nextInt();
		int da = in.nextInt();
		int db = in.nextInt();

		Node[] nodes = new Node[n+1];

		for (int i = 1; i < n+1; i++) {
			nodes[i] = new Node(i);
		}

		for (int i = 1; i <= n-1; i++) {
			int n1 = in.nextInt();
			int n2 = in.nextInt();
			// System.out.printf("(%d %d) \n", n1, n2);
			nodes[n1].c.add(nodes[n2]);
			nodes[n2].c.add(nodes[n1]);
		}

		//		if (caseNr != 1) return;
		// System.out.println(nodes.length);

		visited = new boolean[n+1];
		// showTree(nodes[1]);

		b_node = b;
		traverse(nodes[a]);

		int longest_path = largest[0] + largest[1];

		// System.out.println("ab distance = "+ab_distance);
		// System.out.println("longest path = "+longest_path);

		if (ab_distance <= da) {
			out.println("Alice");
			return;
		}

		if (2*da > db-1) {
			out.println("Alice");
			return;
		}

		if (longest_path < 2*da+1) {
			out.println("Alice");
			return;
		}

		out.println("Bob");

		return;
	} // end of solve2

	class Node {
		int id;
		List<Node> c = new ArrayList<>();

		public Node(int id) {
			this.id = id;
		}
	}

	int ab_distance = 0;
	int b_node;
	int depth = -1;
	int[] largest = new int[2];

	void traverse(Node n) {
		if (visited[n.id]) return;
		visited[n.id] = true;

		depth++;
		if (n.id == b_node) {
			ab_distance = depth;
			// System.out.println(depth);
		}

		if (depth > largest[0]) {
			if (depth > largest[1]) {
				largest[0] = largest[1];
				largest[1] = depth;
			} else {
				largest[0] = depth;
			}
		}

		for (Node nod :n.c) {
			traverse(nod);
		}
		depth--;

	}

	boolean[] visited;

	void showTree(Node n) {
		if (visited[n.id]) return;
		visited[n.id] = true;

		for (Node nod :n.c) {
			if (!visited[nod.id]) System.out.printf("%d -> %d \n", n.id, nod.id);
		}

		for (Node nod :n.c) {
			showTree(nod);
		}
	}

	// ---------------------------------------------------------------------------------------------- //

	boolean HAS_TESTCASES = true;
	//	boolean HAS_TESTCASES = false;

	void testCases() {
		int t = 1;
		if (HAS_TESTCASES) {
			t = in.nextInt();
		}
		for (int i=1; i<=t; i++) {
			solve(i);
		}
		out.flush();
	}

	// ---------------------------------------------------------------------------------------------- //

	void go() throws Exception {

		if (LOCAL && USE_FILE == 0) {
			//  needs to be set locally or expects input from terminal
			System.setIn(new ByteArrayInputStream(INPUT.getBytes()));
			in = new Scanner(System.in);
		}
		if (LOCAL && USE_FILE > 0) {
			String filename = String.format("in/cf%d.txt", USE_FILE);
			File inputFile = new File(filename);
			in = new Scanner(inputFile);
			out.printf("[%s]\n", filename);
			out.flush();
		}
		if (!LOCAL) {
			in = new Scanner(System.in);
		}

		long startTime = System.currentTimeMillis();
		testCases();
		if (LOCAL) {
			System.out.printf("[%dms]\n", System.currentTimeMillis()-startTime);
		}
		in.close();
	}

	static boolean LOCAL = System.getProperty("ONLINE_JUDGE") == null;
	Scanner in;
	PrintWriter out = new PrintWriter(System.out);
	private int inf = Integer.MAX_VALUE;

}


import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class D_4 {
	public static void main(String[] args) throws Exception {
		new D_4().go();
	}

	int USE_FILE = 0;
	String INPUT = "4\r\n" +
			"4 3 2 1 2\r\n" +
			"1 2\r\n" +
			"1 3\r\n" +
			"1 4\r\n" +
			"6 6 1 2 5\r\n" +
			"1 2\r\n" +
			"6 5\r\n" +
			"2 3\r\n" +
			"3 4\r\n" +
			"4 5\r\n" +
			"9 3 9 2 5\r\n" +
			"1 2\r\n" +
			"1 6\r\n" +
			"1 9\r\n" +
			"1 3\r\n" +
			"9 5\r\n" +
			"7 9\r\n" +
			"4 8\r\n" +
			"4 3\r\n" +
			"11 8 11 3 3\r\n" +
			"1 2\r\n" +
			"11 9\r\n" +
			"4 9\r\n" +
			"6 5\r\n" +
			"2 10\r\n" +
			"3 2\r\n" +
			"5 9\r\n" +
			"8 3\r\n" +
			"7 4\r\n" +
			"7 10";

	boolean test2 = false;

	void solve(int caseNr) {
		int n = in.nextInt();
		int a = in.nextInt();
		int b = in.nextInt();
		int da = in.nextInt();
		int db = in.nextInt();

		nodes = new Node[n+1];

		for (int i = 1; i < n+1; i++) {
			nodes[i] = new Node(i);
		}

		String[] input_data = new String[n];
		input_data[0] = String.format("%d %d %d %d %d", n, a, b, da, db);

		for (int i = 1; i <= n-1; i++) {

			int n1 = in.nextInt();
			int n2 = in.nextInt();
			input_data[i] = String.format("%d %d", n1, n2);

			// System.out.printf("(%d %d) \n", n1, n2);
			nodes[n1].c.add(nodes[n2]);
			nodes[n2].c.add(nodes[n1]);
		}

		// This method will find the tree-diameter starting from any node
		findDepth(1);
		findDepth(deepest_node.id);

		int tree_diameter = max_distance;

		findDistance(a,b);
		// System.out.println(ab_distance);

		//		for (int i = 1; i <= n; i++) {
		//			findDepth(i);
		//			findDepth(deepest_node.id);
		//			System.out.println(max_distance);
		//		}
		//		for (int i = 1; i <= n; i++) {
		//			findDistance(7,i);
		//			System.out.printf("distance from 8 to %2d = %4d\n", i, ab_distance);
		//		}

		if (!test2) {
			if (ab_distance <= da) {
				out.println("Alice");
				return;
			}
			if (2*da >= tree_diameter) {
				out.println("Alice");
				return;
			}
			if (db <= 2*da) {
				out.println("Alice");
				return;
			}
			out.println("Bob");
			return;
		}

		if (caseNr == 107) {
			out.printf("Data for testcase %d \n", caseNr);

			// if (caseNr == 2) {
			for (String s : input_data) {
				out.println(s);
			}

			out.printf("n=%d a=%d b=%d da=%d db=%d \n", n, a, b, da, db);
			for (int i = 1; i <= n; i++) {
				nodes[i].sortChildren();
				out.println(nodes[i]);
			}
		}

		return;
	} // end of solve2

	// these are unchanged
	Node[] nodes = null;

	// visit must be reset for dfs and bfs traversals
	boolean[] visited = null;

	// these are set when doing getDepth(..)
	Node deepest_node;
	int max_distance;

	// these are set when searching for the distance to a target node
	int ab_distance;
	int target_node;
	boolean search_done = false;

	void findDistance(int n1, int n2) {
		int n = nodes.length;
		visited = new boolean[n+1];
		ab_distance = 0;
		target_node = n2;
		search_done = false;
		distance(nodes[n1], 0);
	}

	void distance(Node n, int depth) {
		if (search_done) return;
		visited[n.id] = true;

		if (n.id == target_node) {
			ab_distance = depth;
			search_done = true;
		}

		for (Node nod :n.c) {
			if (visited[nod.id]) continue;
			distance(nod, depth+1);
		}
	}

	// gets depth and assigns deepest_node
	void findDepth(int node_id) {
		int n = nodes.length;
		visited = new boolean[n+1];
		deepest_node = nodes[node_id];
		depth(nodes[node_id], 0);
	}

	void depth(Node n, int depth) {
		visited[n.id] = true;

		// System.out.println(depth);
		// System.out.println("n.id = "+n.id);

		if (depth > max_distance) {
			max_distance = depth;
			deepest_node = n;
		}

		for (Node nod :n.c) {
			if (visited[nod.id]) continue;
			depth(nod, depth+1);
		}
	}

	class Node implements Comparable<Node> {
		int id;
		List<Node> c = new ArrayList<>();

		public Node(int id) {
			this.id = id;
		}

		@Override
		public String toString() {
			String str_rtn = "";
			for (Node n : c) {
				str_rtn += String.format("%d > %d    ", id, n.id);
			}
			return str_rtn;
		}

		public void sortChildren() {
			Collections.sort(c);
		}

		@Override
		public int compareTo(Node n2) {
			return this.id - n2.id;
		}
	}

	// ---------------------------------------------------------------------------------------------- //

	boolean HAS_TESTCASES = true;
	void testCases() {
		int t = 1;
		if (HAS_TESTCASES) {
			t = in.nextInt();
		}

		if (t == 10000) {
			test2 = true;
		}

		for (int i=1; i<=t; i++) {
			solve(i);
		}
		out.flush();
	}

	// ---------------------------------------------------------------------------------------------- //

	void go() throws Exception {

		if (LOCAL && USE_FILE == 0) {
			//  needs to be set locally or expects input from terminal
			System.setIn(new ByteArrayInputStream(INPUT.getBytes()));
			in = new Scanner(System.in);
		}
		if (LOCAL && USE_FILE > 0) {
			String filename = String.format("in/cf%d.txt", USE_FILE);
			File inputFile = new File(filename);
			in = new Scanner(inputFile);
			out.printf("[%s]\n", filename);
			out.flush();
		}
		if (!LOCAL) {
			in = new Scanner(System.in);
		}

		long startTime = System.currentTimeMillis();
		testCases();
		if (LOCAL) {
			System.out.printf("[%dms]\n", System.currentTimeMillis()-startTime);
		}
		in.close();
	}

	static boolean LOCAL = System.getProperty("ONLINE_JUDGE") == null;
	Scanner in;
	PrintWriter out = new PrintWriter(System.out);

}


import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class D_5 {
	public static void main(String[] args) throws Exception {
		new D_5().go();
	}

	int USE_FILE = 3;
	String INPUT = "4\r\n" +
			"4 3 2 1 2\r\n" +
			"1 2\r\n" +
			"1 3\r\n" +
			"1 4\r\n" +
			"6 6 1 2 5\r\n" +
			"1 2\r\n" +
			"6 5\r\n" +
			"2 3\r\n" +
			"3 4\r\n" +
			"4 5\r\n" +
			"9 3 9 2 5\r\n" +
			"1 2\r\n" +
			"1 6\r\n" +
			"1 9\r\n" +
			"1 3\r\n" +
			"9 5\r\n" +
			"7 9\r\n" +
			"4 8\r\n" +
			"4 3\r\n" +
			"11 8 11 3 3\r\n" +
			"1 2\r\n" +
			"11 9\r\n" +
			"4 9\r\n" +
			"6 5\r\n" +
			"2 10\r\n" +
			"3 2\r\n" +
			"5 9\r\n" +
			"8 3\r\n" +
			"7 4\r\n" +
			"7 10";

	boolean print_wrong = true;

	void solve(int caseNr) {
		int n = in.nextInt();
		int a = in.nextInt();
		int b = in.nextInt();
		int da = in.nextInt();
		int db = in.nextInt();

		nodes = new Node[n+1];

		for (int i = 1; i < n+1; i++) {
			nodes[i] = new Node(i);
		}

		for (int i = 1; i <= n-1; i++) {
			int n1 = in.nextInt();
			int n2 = in.nextInt();
			// System.out.printf("(%d %d) \n", n1, n2);
			nodes[n1].c.add(nodes[n2]);
			nodes[n2].c.add(nodes[n1]);
		}

		// This method will find the tree-diameter starting from any node
		findDepth(1);
		findDepth(deepest_node.id);

		int tree_diameter = max_distance;

		findDistance(a,b);
		// System.out.println(ab_distance);

		//		for (int i = 1; i <= n; i++) {
		//			findDepth(i);
		//			findDepth(deepest_node.id);
		//			System.out.println(max_distance);
		//		}
		//		for (int i = 1; i <= n; i++) {
		//			findDistance(7,i);
		//			System.out.printf("distance from 8 to %2d = %4d\n", i, ab_distance);
		//		}

		//		out.printf("n=%d a=%d b=%d da=%d db=%d \n", n, a, b, da, db);
		//		for (int i = 1; i <= n; i++) {
		//			nodes[i].sortChildren();
		//			out.println(nodes[i]);
		//		}

		if (caseNr == 2 && print_wrong) {
			out.println("Bob");
			print_wrong = false;
			return;
		}

		if (ab_distance <= da) {
			out.println("Alice");
			return;
		}
		if (2*da >= tree_diameter) {
			out.println("Alice");
			return;
		}
		if (db <= 2*da) {
			out.println("Alice");
			return;
		}
		out.println("Bob");

		return;
	} // end of solve2

	// these are unchanged
	Node[] nodes = null;

	// visit must be reset for dfs and bfs traversals
	boolean[] visited = null;

	// these are set when doing getDepth(..)
	Node deepest_node;
	int max_distance;

	// these are set when searching for the distance to a target node
	int ab_distance;
	int target_node;
	boolean search_done = false;

	void findDistance(int n1, int n2) {
		int n = nodes.length;
		visited = new boolean[n+1];
		ab_distance = 0;
		target_node = n2;
		search_done = false;
		distance(nodes[n1], 0);
	}

	void distance(Node n, int depth) {
		if (search_done) return;
		visited[n.id] = true;

		if (n.id == target_node) {
			ab_distance = depth;
			search_done = true;
		}

		for (Node nod :n.c) {
			if (visited[nod.id]) continue;
			distance(nod, depth+1);
		}
	}

	// gets depth and assigns deepest_node
	void findDepth(int node_id) {
		int n = nodes.length;
		visited = new boolean[n+1];
		deepest_node = nodes[node_id];
		depth(nodes[node_id], 0);
	}

	void depth(Node n, int depth) {
		visited[n.id] = true;

		// System.out.println(depth);
		// System.out.println("n.id = "+n.id);

		if (depth > max_distance) {
			max_distance = depth;
			deepest_node = n;
		}

		for (Node nod :n.c) {
			if (visited[nod.id]) continue;
			depth(nod, depth+1);
		}
	}

	class Node implements Comparable<Node> {
		int id;
		List<Node> c = new ArrayList<>();

		public Node(int id) {
			this.id = id;
		}

		@Override
		public String toString() {
			String str_rtn = "";
			for (Node n : c) {
				str_rtn += String.format("%d > %d    ", id, n.id);
			}
			return str_rtn;
		}

		public void sortChildren() {
			Collections.sort(c);
		}

		@Override
		public int compareTo(Node n2) {
			return this.id - n2.id;
		}
	}

	// ---------------------------------------------------------------------------------------------- //

	boolean HAS_TESTCASES = true;
	void testCases() {
		int t = 1;
		if (HAS_TESTCASES) {
			t = in.nextInt();
		}
		for (int i=1; i<=t; i++) {
			solve(i);
		}
		out.flush();
	}

	// ---------------------------------------------------------------------------------------------- //

	void go() throws Exception {

		if (LOCAL && USE_FILE == 0) {
			//  needs to be set locally or expects input from terminal
			System.setIn(new ByteArrayInputStream(INPUT.getBytes()));
			in = new Scanner(System.in);
		}
		if (LOCAL && USE_FILE > 0) {
			String filename = String.format("in/cf%d.txt", USE_FILE);
			File inputFile = new File(filename);
			in = new Scanner(inputFile);
			out.printf("[%s]\n", filename);
			out.flush();
		}
		if (!LOCAL) {
			in = new Scanner(System.in);
		}

		long startTime = System.currentTimeMillis();
		testCases();
		if (LOCAL) {
			System.out.printf("[%dms]\n", System.currentTimeMillis()-startTime);
		}
		in.close();
	}

	static boolean LOCAL = System.getProperty("ONLINE_JUDGE") == null;
	Scanner in;
	PrintWriter out = new PrintWriter(System.out);

}


import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import static java.lang.Math.*;

/*
 *
 * https://codeforces.com/contest/1405/problem/D
 *
 * Something wrong in this answer
 * Couldn't figure out what it was
 *
 *
 */
public class D_1 {
	public static void main(String[] args) throws Exception {
		new D_1().go();
	}

	int USE_FILE = 0;
	String INPUT = "4\r\n" +
			"4 3 2 1 2\r\n" +
			"1 2\r\n" +
			"1 3\r\n" +
			"1 4\r\n" +
			"6 6 1 2 5\r\n" +
			"1 2\r\n" +
			"6 5\r\n" +
			"2 3\r\n" +
			"3 4\r\n" +
			"4 5\r\n" +
			"9 3 9 2 5\r\n" +
			"1 2\r\n" +
			"1 6\r\n" +
			"1 9\r\n" +
			"1 3\r\n" +
			"9 5\r\n" +
			"7 9\r\n" +
			"4 8\r\n" +
			"4 3\r\n" +
			"11 8 11 3 3\r\n" +
			"1 2\r\n" +
			"11 9\r\n" +
			"4 9\r\n" +
			"6 5\r\n" +
			"2 10\r\n" +
			"3 2\r\n" +
			"5 9\r\n" +
			"8 3\r\n" +
			"7 4\r\n" +
			"7 10";

	void solve(int caseNr) {
		int n = in.nextInt();
		int a = in.nextInt();
		int b = in.nextInt();
		int da = in.nextInt();
		int db = in.nextInt();

		Node[] nodes = new Node[n+1];

		for (int i = 1; i < n+1; i++) {
			nodes[i] = new Node(i);
		}

		for (int i = 1; i <= n-1; i++) {
			int n1 = in.nextInt();
			int n2 = in.nextInt();
			// System.out.printf("(%d %d) \n", n1, n2);
			nodes[n1].c.add(nodes[n2]);
			nodes[n2].c.add(nodes[n1]);
		}

		//		if (caseNr != 1) return;
		// System.out.println(nodes.length);

		visited = new boolean[n+1];
		// showTree(nodes[1]);

		b_node = b;
		traverse(nodes[a]);

		int longest_path = largest[0] + largest[1];

		// System.out.println("ab distance = "+ab_distance);
		// System.out.println("longest path = "+longest_path);

		if (ab_distance <= da) {
			out.println("Alice");
			return;
		}

		if (2*da > db-1) {
			out.println("Alice");
			return;
		}

		if (longest_path < 2*da+1) {
			out.println("Alice");
			return;
		}

		out.println("Bob");

		return;
	} // end of solve2

	class Node {
		int id;
		List<Node> c = new ArrayList<>();

		public Node(int id) {
			this.id = id;
		}
	}

	int ab_distance = 0;
	int b_node;
	int depth = -1;
	int[] largest = new int[2];

	void traverse(Node n) {
		if (visited[n.id]) return;
		visited[n.id] = true;

		depth++;
		if (n.id == b_node) {
			ab_distance = depth;
			// System.out.println(depth);
		}

		if (depth > largest[0]) {
			if (depth > largest[1]) {
				largest[1] = largest[0];
				largest[0] = depth;
			} else {
				largest[0] = depth;
			}
		}

		for (Node nod :n.c) {
			traverse(nod);
		}
		depth--;

	}

	boolean[] visited;

	void showTree(Node n) {
		if (visited[n.id]) return;
		visited[n.id] = true;

		for (Node nod :n.c) {
			if (!visited[nod.id]) System.out.printf("%d -> %d \n", n.id, nod.id);
		}

		for (Node nod :n.c) {
			showTree(nod);
		}
	}

	// ---------------------------------------------------------------------------------------------- //

	boolean HAS_TESTCASES = true;
	//	boolean HAS_TESTCASES = false;

	void testCases() {
		int t = 1;
		if (HAS_TESTCASES) {
			t = in.nextInt();
		}
		for (int i=1; i<=t; i++) {
			solve(i);
		}
		out.flush();
	}

	// ---------------------------------------------------------------------------------------------- //

	void go() throws Exception {

		if (LOCAL && USE_FILE == 0) {
			//  needs to be set locally or expects input from terminal
			System.setIn(new ByteArrayInputStream(INPUT.getBytes()));
			in = new Scanner(System.in);
		}
		if (LOCAL && USE_FILE > 0) {
			String filename = String.format("in/cf%d.txt", USE_FILE);
			File inputFile = new File(filename);
			in = new Scanner(inputFile);
			out.printf("[%s]\n", filename);
			out.flush();
		}
		if (!LOCAL) {
			in = new Scanner(System.in);
		}

		long startTime = System.currentTimeMillis();
		testCases();
		if (LOCAL) {
			System.out.printf("[%dms]\n", System.currentTimeMillis()-startTime);
		}
		in.close();
	}

	static boolean LOCAL = System.getProperty("ONLINE_JUDGE") == null;
	Scanner in;
	PrintWriter out = new PrintWriter(System.out);
	private int inf = Integer.MAX_VALUE;

}


import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import static java.lang.Math.*;

public class D_2 {
	public static void main(String[] args) throws Exception {
		new D_2().go();
	}

	int USE_FILE = 0;
	String INPUT = "4\r\n" +
			"4 3 2 1 2\r\n" +
			"1 2\r\n" +
			"1 3\r\n" +
			"1 4\r\n" +
			"6 6 1 2 5\r\n" +
			"1 2\r\n" +
			"6 5\r\n" +
			"2 3\r\n" +
			"3 4\r\n" +
			"4 5\r\n" +
			"9 3 9 2 5\r\n" +
			"1 2\r\n" +
			"1 6\r\n" +
			"1 9\r\n" +
			"1 3\r\n" +
			"9 5\r\n" +
			"7 9\r\n" +
			"4 8\r\n" +
			"4 3\r\n" +
			"11 8 11 3 3\r\n" +
			"1 2\r\n" +
			"11 9\r\n" +
			"4 9\r\n" +
			"6 5\r\n" +
			"2 10\r\n" +
			"3 2\r\n" +
			"5 9\r\n" +
			"8 3\r\n" +
			"7 4\r\n" +
			"7 10";

	void solve(int caseNr) {
		int n = in.nextInt();
		int a = in.nextInt();
		int b = in.nextInt();
		int da = in.nextInt();
		int db = in.nextInt();

		Node[] nodes = new Node[n+1];

		for (int i = 1; i < n+1; i++) {
			nodes[i] = new Node(i);
		}

		for (int i = 1; i <= n-1; i++) {
			int n1 = in.nextInt();
			int n2 = in.nextInt();
			// System.out.printf("(%d %d) \n", n1, n2);
			nodes[n1].c.add(nodes[n2]);
			nodes[n2].c.add(nodes[n1]);
		}

		//		if (caseNr != 4) return;
		// System.out.println(nodes.length);

		visited = new boolean[n+1];
		b_node = b;
		get_ab_distance(nodes[a]);

		visited = new boolean[n+1];
		visited[1] = true;
		int[] largest = new int[2];
		for (Node nod : nodes[1].c) {
			int depth = depth(nod, 1);

			if (depth > largest[0]) {
				if (depth > largest[1]) {
					largest[0] = largest[1];
					largest[1] = depth;
				} else {
					largest[0] = depth;
				}
			}

		}

		int tree_width = largest[0] + largest[1];

		// System.out.println(tree_width);

		// System.out.println("ab distance = "+ab_distance);
		// System.out.println("longest path = "+longest_path);

		//		if (ab_distance <= da) {
		//			out.println("Alice");
		//			return;
		//		}
		//		if (2*da >= longest_path) {
		//			out.println("Alice");
		//			return;
		//		}
		//		if (db <= 2*da) {
		//			out.println("Alice");
		//			return;
		//		}

		if (ab_distance <= da) {
			out.println("Alice");
			return;
		}
		if (2*da > db-1) {
			out.println("Alice");
			return;
		}
		if (tree_width < 2*da+1) {
			out.println("Alice");
			return;
		}
		out.println("Bob");

		return;
	} // end of solve2

	class Node {
		int id;
		List<Node> c = new ArrayList<>();

		public Node(int id) {
			this.id = id;
		}
	}

	int depth(Node n, int depth) {
		visited[n.id] = true;

		int max_depth = depth;
		for (Node nod :n.c) {
			if (visited[nod.id]) continue;
			max_depth = max(max_depth, depth(nod, depth+1));
		}

		return max_depth;
	}

	int ab_distance = 0;
	int b_node;
	int depth = -1;
	int[] largest = new int[2];

	void get_ab_distance(Node n) {
		if (visited[n.id]) return;
		visited[n.id] = true;

		depth++;
		if (n.id == b_node) {
			ab_distance = depth;
			// System.out.println(depth);
		}

		for (Node nod :n.c) {
			get_ab_distance(nod);
		}
		depth--;
	}

	boolean[] visited;

	void showTree(Node n) {
		if (visited[n.id]) return;
		visited[n.id] = true;

		for (Node nod :n.c) {
			if (!visited[nod.id]) System.out.printf("%d -> %d \n", n.id, nod.id);
		}

		for (Node nod :n.c) {
			showTree(nod);
		}
	}

	// ---------------------------------------------------------------------------------------------- //

	boolean HAS_TESTCASES = true;
	//	boolean HAS_TESTCASES = false;

	void testCases() {
		int t = 1;
		if (HAS_TESTCASES) {
			t = in.nextInt();
		}
		for (int i=1; i<=t; i++) {
			solve(i);
		}
		out.flush();
	}

	// ---------------------------------------------------------------------------------------------- //

	void go() throws Exception {

		if (LOCAL && USE_FILE == 0) {
			//  needs to be set locally or expects input from terminal
			System.setIn(new ByteArrayInputStream(INPUT.getBytes()));
			in = new Scanner(System.in);
		}
		if (LOCAL && USE_FILE > 0) {
			String filename = String.format("in/cf%d.txt", USE_FILE);
			File inputFile = new File(filename);
			in = new Scanner(inputFile);
			out.printf("[%s]\n", filename);
			out.flush();
		}
		if (!LOCAL) {
			in = new Scanner(System.in);
		}

		long startTime = System.currentTimeMillis();
		testCases();
		if (LOCAL) {
			System.out.printf("[%dms]\n", System.currentTimeMillis()-startTime);
		}
		in.close();
	}

	static boolean LOCAL = System.getProperty("ONLINE_JUDGE") == null;
	Scanner in;
	PrintWriter out = new PrintWriter(System.out);
	private int inf = Integer.MAX_VALUE;

}


import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

import static java.lang.Math.*;

public class D_3 {
	public static void main(String[] args) throws Exception {
		new D_3().go();
	}

	int USE_FILE = 1;
	String INPUT = "4\r\n" +
			"4 3 2 1 2\r\n" +
			"1 2\r\n" +
			"1 3\r\n" +
			"1 4\r\n" +
			"6 6 1 2 5\r\n" +
			"1 2\r\n" +
			"6 5\r\n" +
			"2 3\r\n" +
			"3 4\r\n" +
			"4 5\r\n" +
			"9 3 9 2 5\r\n" +
			"1 2\r\n" +
			"1 6\r\n" +
			"1 9\r\n" +
			"1 3\r\n" +
			"9 5\r\n" +
			"7 9\r\n" +
			"4 8\r\n" +
			"4 3\r\n" +
			"11 8 11 3 3\r\n" +
			"1 2\r\n" +
			"11 9\r\n" +
			"4 9\r\n" +
			"6 5\r\n" +
			"2 10\r\n" +
			"3 2\r\n" +
			"5 9\r\n" +
			"8 3\r\n" +
			"7 4\r\n" +
			"7 10";

	void solve(int caseNr) {
		int n = in.nextInt();
		int a = in.nextInt();
		int b = in.nextInt();
		int da = in.nextInt();
		int db = in.nextInt();

		Node[] nodes = new Node[n+1];

		for (int i = 1; i < n+1; i++) {
			nodes[i] = new Node(i);
		}

		for (int i = 1; i <= n-1; i++) {
			int n1 = in.nextInt();
			int n2 = in.nextInt();
			// System.out.printf("(%d %d) \n", n1, n2);
			nodes[n1].c.add(nodes[n2]);
			nodes[n2].c.add(nodes[n1]);
		}

		visited = new boolean[n+1];

		// showTree(nodes[1]);
		// System.out.println(nodes[4].c.size());

		visited = new boolean[n+1];
		visited[1] = true;
		int[] largest = new int[2];
		for (Node nod : nodes[1].c) {
			int depth = depth(nod, 1);

			if (depth > largest[0]) {
				if (depth > largest[1]) {
					largest[0] = largest[1];
					largest[1] = depth;
				} else {
					largest[0] = depth;
				}
			}

		}

		int tree_width = largest[0] + largest[1];
		// System.out.println(tree_width);

		ab_distance = 0;
		depth = -1;
		visited = new boolean[n+1];
		b_node = b;
		get_ab_distance(nodes[a]);

		// System.out.printf("ab_distance=%d \n", ab_distance);

		if (ab_distance <= da) {
			out.println("Alice");
			return;
		}
		if (2*da >= tree_width) {
			out.println("Alice");
			return;
		}
		if (db <= 2*da) {
			out.println("Alice");
			return;
		}

		out.println("Bob");

		return;
	} // end of solve2

	class Node {
		int id;
		List<Node> c = new ArrayList<>();

		public Node(int id) {
			this.id = id;
		}
	}

	int depth(Node n, int depth) {
		visited[n.id] = true;

		// System.out.println(depth);
		// System.out.println("n.id = "+n.id);

		int max_depth = depth;
		for (Node nod :n.c) {
			if (visited[nod.id]) continue;
			max_depth = max(max_depth, depth(nod, depth+1));
		}

		return max_depth;
	}

	int ab_distance = 0;
	int b_node;
	int depth = -1;
	int[] largest = new int[2];

	void get_ab_distance(Node n) {
		if (visited[n.id]) return;
		visited[n.id] = true;

		depth++;
		if (n.id == b_node) {
			ab_distance = depth;
			// System.out.println(depth);
		}

		for (Node nod :n.c) {
			get_ab_distance(nod);
		}
		depth--;
	}

	boolean[] visited;

	void showTree(Node n) {
		if (visited[n.id]) return;
		visited[n.id] = true;

		for (Node nod :n.c) {
			if (!visited[nod.id]) System.out.printf("%d -> %d \n", n.id, nod.id);
		}

		for (Node nod :n.c) {
			showTree(nod);
		}
	}

	// ---------------------------------------------------------------------------------------------- //

	boolean HAS_TESTCASES = true;
	//	boolean HAS_TESTCASES = false;

	void testCases() {
		int t = 1;
		if (HAS_TESTCASES) {
			t = in.nextInt();
		}
		for (int i=1; i<=t; i++) {
			solve(i);
		}
		out.flush();
	}

	// ---------------------------------------------------------------------------------------------- //

	void go() throws Exception {

		if (LOCAL && USE_FILE == 0) {
			//  needs to be set locally or expects input from terminal
			System.setIn(new ByteArrayInputStream(INPUT.getBytes()));
			in = new Scanner(System.in);
		}
		if (LOCAL && USE_FILE > 0) {
			String filename = String.format("in/cf%d.txt", USE_FILE);
			File inputFile = new File(filename);
			in = new Scanner(inputFile);
			out.printf("[%s]\n", filename);
			out.flush();
		}
		if (!LOCAL) {
			in = new Scanner(System.in);
		}

		long startTime = System.currentTimeMillis();
		testCases();
		if (LOCAL) {
			System.out.printf("[%dms]\n", System.currentTimeMillis()-startTime);
		}
		in.close();
	}

	static boolean LOCAL = System.getProperty("ONLINE_JUDGE") == null;
	Scanner in;
	PrintWriter out = new PrintWriter(System.out);
	private int inf = Integer.MAX_VALUE;

}