stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int dis[10];



bool likes(int n){

    while(n){

        if(dis[n%10] == true) return false;

        n /= 10;

    }

    return true;

}



int main(){

    int n, k, x;

    cin >> n >> k;

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

        cin >> x;

        dis[x] = true;

    }

    while(likes(n) == false) n++;

    cout << n << '\n';

    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

#include<algorithm>

int n,k,tmp;

bool u[11];

bool check(int t)

{

    while(t)

    {

        if (u[t%10]) return 0;

        t/=10;

    }

    return 1;

}

int main()

{

    scanf("%d%d",&n,&k);

    for(int i=1;i<=k;i++)

    {

        scanf("%d",&tmp);

        u[tmp]=1;

    }

    int cur=n;

    while(!check(cur)) cur++;

    printf("%d",cur);

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<algorithm>

using namespace std;

int k[15],a[101],flag,k1,vis[101];

int main(){

	int n,k2;

	cin>>n>>k2;

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

		cin>>k[i];

		vis[k[i]]=true;

	}

	for(int m=1;m<=100000;m++){

		k1=0,flag=0;

		int i=m;

		while(i>0){

			a[k1++]=i%10;

			i/=10;

		}

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

			if(vis[a[j]]){

			flag=1;

			continue;	

			} 

		}

		if(flag==0&&m>=n){

		cout<<m<<endl;	

		break;

		} 

		

	}

	

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;



typedef long long ll;

typedef pair<int, int> pii;

typedef pair<int, pii> pipii;

typedef pair<pii, pii> piipii;



#define mp make_pair

#define fi first

#define se second

#define all(a) (a).begin(), (a).end()

#define sz(a) (int)(a).size()

#define eb emplace_back



char s[105];

bool vis[10];

int main(){

    int n, k, a;

    scanf("%d%d", &n, &k);

    for(int i=1;i<=k;i++) scanf("%d", &a), vis[a] = 1;

    for(int i=n;;i++){

        int x = i;

        bool ok = 1;

        while(x > 0){

            if(vis[x%10]){

                ok = 0;

                break;

            }

            x/=10;

        }

        if(ok){

            printf("%d\n", i);

            return 0;

        }

    }

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main(){

	int n,k;

	cin>>n>>k;

	int i,j;

	bool d[10]={};

	for(i=0;i<k;i++){

		cin>>j;

		d[j]=true;

	}

	string s;

	bool f;

	char c[10];

	for(i=0;i<10;i++) c[i]='0'+i;

	for(i=n;i<n*100;i++){

		stringstream ss;

		ss<<i;

		s=ss.str();

		f=true;

		for(j=0;j<10;j++){

			if(d[j]&&s.find(c[j])!=-1){

				f=false;

				break;

			}

		}

		if(f){

			cout<<i<<endl;

			break;

		}

	}

	return 0;

}

// Optimized solution to the same problem (faster):
#include <iostream>

#include <string.h>

#include <bits/stdc++.h>



using namespace std;



int main()

{

    int n,a[20]={0},b[15]={0},j,i,o=0;

    int k=0,l=0,flag=0,e=0,f;

    char c[6]={0};

    scanf("%s%d",c,&n);

    for(i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }



    for(i=0;i<10;i++)

    {

        if(i==a[k]&&k<n-1) k++;

        else if(i==a[n-1]);

        else b[l++]=i;

    }

    f=strlen(c);

    for(i=0;i<f;i++)

    {

        c[i]-='0';

    }

    for(i=f-1;i>=0;i--)

    {

        flag=0;

        o=0;

        for(j=0; j<l; j++)

        {

            if(c[i]<b[j])

            {

                c[i]=b[j];

                flag=1;

                break;

            }

            else if(c[i]==b[j])

            {

                c[i]=b[j];

                o=1;

                break;

            }

        }

        if(flag==0&&i>0&&o==0)

        {

            for(j=i;j<f;j++)

            {

                c[j]=b[0];

            }

            c[i-1]++;

        }

        else if(flag==0&&b[0]!=0&&o==0) e=b[0];

        else if(flag==0&&b[0]==0&&o==0) e=b[1];

        if(flag==1||e!=0)

        {

            for(j=i+1;j<f;j++)

            {

                c[j]=b[0];

            }

            if(e!=0) c[0]=b[0];

        }

    }



    if(e!=0)

    printf("%d",e);

    for(i=0;i<f;i++)

    {

        printf("%d",c[i]);

    }

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

bool ng[10];

signed main(){

	int n,k;

	cin>>n>>k;

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

		int d;cin>>d;

		ng[d]=true;

	}

	for(;;n++){

		stringstream ss;

		ss<<n;

		string s=ss.str();

		bool ok=true;

		for(int j=0;j<s.size();j++) if(ng[s[j]-'0']) ok=false;

		if(ok){

			cout<<n<<endl;

			return 0;

		}

	}

	return 0;

}

// Optimized solution to the same problem (faster):
#include<bits/stdc++.h>

using namespace std;

int bit(int x){

	int r=0;

	while(x){

		r|=1<<(x%10);

		x/=10;

	}

	return r;

}

int main(){

	int n,k,b=0;

	scanf("%d %d",&n,&k);

	while(k--){

		int x;

		scanf("%d",&x);

		b|=1<<x;

	}

	while(bit(n)&b) n++;

	printf("%d\n",n);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<iostream>

#include<algorithm>

using namespace std;



int p[10];

int ans=100000;

int n,k;

void dfs(int sum,int q){

	//printf("%d %d\n",sum,q);

	if(sum>=n){ans=min(ans,sum);return;}

	if(q>10000)return;

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

		if(!p[i]){/*printf("%d\n",i);*/dfs(sum+q*i,q*10);}

	}

}

int main(){

	scanf("%d%d",&n,&k);

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

		int c;

		scanf("%d",&c);

		p[c]=1;

	}

	dfs(0,1);

	printf("%d\n",ans);

	return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

#include<ext/pb_ds/hash_policy.hpp>

#include<ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;

using namespace std;

typedef long long LL;

typedef unsigned long long uLL;

struct custom_hash {

    static uint64_t splitmix64(uint64_t x) {

        x += 0x9e3779b97f4a7c15;

        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;

        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;

        return x ^ (x >> 31);

    }

    size_t operator()(uint64_t x) const {

        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();

        return splitmix64(x + FIXED_RANDOM);

    }

};

LL z = 1;

int read(){

	int x, f = 1;

	char ch;

	while(ch = getchar(), ch < '0' || ch > '9') if(ch == '-') f = -1;

	x = ch - '0';

	while(ch = getchar(), ch >= '0' && ch <= '9') x = x * 10 + ch - 48;

	return x * f;

}

int ksm(int a, int b, int p){

	int s = 1;

	while(b){

		if(b & 1) s = z * s * a % p;

		a = z * a * a % p;

		b >>= 1;

	}

	return s;

}

int v[15], a[15];

char s[15];

int pd(int x){

	int i;

	while(x){

		i = x % 10;

		x /= 10;

		if(v[i]) return 0;

	}

	return 1;

}

int main(){

	int i, j, t, n, m, flag = 0;

	n = read();

	m = read();

	for(i = 1; i <= m; i++){

		j = read();

		v[j] = 1;

	}

	for(i = n; i <= 100000; i++){

		if(pd(i)){

			printf("%d", i);

			return 0;

		}

	}

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
    #include<iostream>

    #include<cstring>

    #include<cstdio>

    #include<cstdlib>

    #include<algorithm>

    #include<map>

    #include<cmath>

    #include<cstdlib>

    using namespace std;

    const int M=105;

char  a[M],b[M];

 int n,m,flag;



int main()

{

    cin>>a;

    cin>>b;

    int i=0;

    flag=0;

    while(b[i]!='\0')

    {

        if(a[i]=='\0')

        {

            flag=1;

            break;

        }

        i++;

    }

    int j=0;

    while(a[j]!='\0')

    {

        if(b[j]=='\0')

        {

            flag=2;

            break;

        }

        j++;

    }

    if(flag==0)

    {

        int k=0;

        while(b[k]!='\0')

        {

            if(a[k]<b[k])

            {

                flag=1;

                break;

            }

            else if(a[k]>b[k])

            {

                flag=2;

                break;

            }

            else if(a[k]==b[k])

            {

                flag=3;

                k++;

            }



        }

    }

    if(flag==1)

        cout<<"LESS"<<endl;

    if(flag==2)

        printf("GREATER");

    if(flag==3)

        printf("EQUAL");



}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>



using namespace std;



int main(){

	char s[205];

	char s1[205];

	int a[205];

	int b[205];

	int flag = 0;

	scanf("%s%s",s,s1);

	int len = strlen(s);

	int len1 = strlen(s1);

	if(len > len1) printf("GREATER\n");

	else if(len < len1) printf("LESS\n");

	else if(len == len1){

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

			a[i] = s[i] - '0';

			}

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

			b[i] = s1[i] - '0';

			}

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

			if(a[i] > b[i]){

				flag = 1;

				printf("GREATER\n");

				break;

			}			

			else if(a[i] < b[i]){

				flag = 1;

				printf("LESS\n");

				break;

				}

		}

		if(flag == 0) printf("EQUAL\n");

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main(){

	long double x,y;

	cin>>x>>y;

	if(x>y)

		cout<<"GREATER";

	else if (x<y)

		cout<<"LESS";

	else

	cout<<"EQUAL";

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>



using namespace std;



int main(){

	char s[205];

	char s1[205];

	int a[205];

	int b[205];

	int flag = 0;

	scanf("%s%s",s,s1);

	int len = strlen(s);

	int len1 = strlen(s1);

	if(len > len1) printf("GREATER\n");

	else if(len < len1) printf("LESS\n");

	else if(len == len1){

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

			a[i] = s[i] - '0';

			}

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

			b[i] = s1[i] - '0';

			}

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

			if(a[i] > b[i]){

				flag = 1;

				printf("GREATER\n");

				break;

			}			

			else if(a[i] < b[i]){

				flag = 1;

				printf("LESS\n");

				break;

				}

		}

		if(flag == 0) printf("EQUAL\n");

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main(){

	string a;

    string b;

    cin>>a>>b;

	if(a.size()>b.size()){

	cout<<"GREATER";

}

	else if(a==b){

	cout<<"EQUAL";

}

	else if(b.size()>a.size()){

	cout<<"LESS";

}

else if(b.size()==a.size()){

	if(a>b)

	cout<<"GREATER";

	else

	cout<<"LESS";

}

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>



using namespace std;



int main(){

	char s[205];

	char s1[205];

	int a[205];

	int b[205];

	int flag = 0;

	scanf("%s%s",s,s1);

	int len = strlen(s);

	int len1 = strlen(s1);

	if(len > len1) printf("GREATER\n");

	else if(len < len1) printf("LESS\n");

	else if(len == len1){

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

			a[i] = s[i] - '0';

			}

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

			b[i] = s1[i] - '0';

			}

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

			if(a[i] > b[i]){

				flag = 1;

				printf("GREATER\n");

				break;

			}			

			else if(a[i] < b[i]){

				flag = 1;

				printf("LESS\n");

				break;

				}

		}

		if(flag == 0) printf("EQUAL\n");

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#include <stdio.h>

using namespace std ;

int main(){

long double A,B;

cin>>A;

cin>>B;

if(A>B)

cout<<"GREATER";

else if(A<B)

cout<<"LESS";

else 

cout<<"EQUAL";

return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>



using namespace std;



int main(){

	char s[205];

	char s1[205];

	int a[205];

	int b[205];

	int flag = 0;

	scanf("%s%s",s,s1);

	int len = strlen(s);

	int len1 = strlen(s1);

	if(len > len1) printf("GREATER\n");

	else if(len < len1) printf("LESS\n");

	else if(len == len1){

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

			a[i] = s[i] - '0';

			}

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

			b[i] = s1[i] - '0';

			}

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

			if(a[i] > b[i]){

				flag = 1;

				printf("GREATER\n");

				break;

			}			

			else if(a[i] < b[i]){

				flag = 1;

				printf("LESS\n");

				break;

				}

		}

		if(flag == 0) printf("EQUAL\n");

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

using namespace std;

 

int main() {

	long double A, B;

cin>>A;

cin>>B;

 

if(A==B) {

cout<<"EQUAL";

} else if(A>B) {

cout<<"GREATER" ;

} else if(A<B) {

cout<<"LESS" ;

}

return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>



using namespace std;



int main(){

	char s[205];

	char s1[205];

	int a[205];

	int b[205];

	int flag = 0;

	scanf("%s%s",s,s1);

	int len = strlen(s);

	int len1 = strlen(s1);

	if(len > len1) printf("GREATER\n");

	else if(len < len1) printf("LESS\n");

	else if(len == len1){

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

			a[i] = s[i] - '0';

			}

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

			b[i] = s1[i] - '0';

			}

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

			if(a[i] > b[i]){

				flag = 1;

				printf("GREATER\n");

				break;

			}			

			else if(a[i] < b[i]){

				flag = 1;

				printf("LESS\n");

				break;

				}

		}

		if(flag == 0) printf("EQUAL\n");

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



int main(){



long double a,b;

cin>>a>>b;



	if(a>b)

	cout<<"GREATER";

	else if(a==b)

	cout<<"EQUAL";

	else if(a<b)

	cout<<"LESS";







return 0;

} 

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>



using namespace std;



int main(){

	char s[205];

	char s1[205];

	int a[205];

	int b[205];

	int flag = 0;

	scanf("%s%s",s,s1);

	int len = strlen(s);

	int len1 = strlen(s1);

	if(len > len1) printf("GREATER\n");

	else if(len < len1) printf("LESS\n");

	else if(len == len1){

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

			a[i] = s[i] - '0';

			}

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

			b[i] = s1[i] - '0';

			}

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

			if(a[i] > b[i]){

				flag = 1;

				printf("GREATER\n");

				break;

			}			

			else if(a[i] < b[i]){

				flag = 1;

				printf("LESS\n");

				break;

				}

		}

		if(flag == 0) printf("EQUAL\n");

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;



int main()

{

    long double A, B;

    cin >> A;

    cin >> B;

    if (A==B){

    cout << "EQUAL";



    } else if (A>B){

    cout <<"GREATER";

    }else if (A<B){

    cout << "LESS";

    }

    return 0;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>



using namespace std;



int main(){

	char s[205];

	char s1[205];

	int a[205];

	int b[205];

	int flag = 0;

	scanf("%s%s",s,s1);

	int len = strlen(s);

	int len1 = strlen(s1);

	if(len > len1) printf("GREATER\n");

	else if(len < len1) printf("LESS\n");

	else if(len == len1){

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

			a[i] = s[i] - '0';

			}

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

			b[i] = s1[i] - '0';

			}

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

			if(a[i] > b[i]){

				flag = 1;

				printf("GREATER\n");

				break;

			}			

			else if(a[i] < b[i]){

				flag = 1;

				printf("LESS\n");

				break;

				}

		}

		if(flag == 0) printf("EQUAL\n");

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <algorithm>

#include <string> 

using namespace std;



typedef long long ll;



int main()

{

    string a,b;

    cin>>a>>b;

    if(a.size()>b.size())

    {

    	cout<<"GREATER"<<endl;

	}

	else if(a.size()<b.size())

	{

		cout<<"LESS"<<endl;

	}

	else if(a==b)

	{

		cout<<"EQUAL"<<endl;

	}

	else

	{

		for(int i=0;i<a.size();i++)

		{

			if(a[i]>b[i])

			{

				cout<<"GREATER"<<endl;return 0;

			}

			if(a[i]<b[i]){

				cout<<"LESS"<<endl;return 0;

			}

		}

		cout<<"EQUAL"<<endl;

	}

    return 0;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>



using namespace std;



int main(){

	char s[205];

	char s1[205];

	int a[205];

	int b[205];

	int flag = 0;

	scanf("%s%s",s,s1);

	int len = strlen(s);

	int len1 = strlen(s1);

	if(len > len1) printf("GREATER\n");

	else if(len < len1) printf("LESS\n");

	else if(len == len1){

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

			a[i] = s[i] - '0';

			}

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

			b[i] = s1[i] - '0';

			}

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

			if(a[i] > b[i]){

				flag = 1;

				printf("GREATER\n");

				break;

			}			

			else if(a[i] < b[i]){

				flag = 1;

				printf("LESS\n");

				break;

				}

		}

		if(flag == 0) printf("EQUAL\n");

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<algorithm>

#include<cstdio>

#include<cstring>

using namespace std;



int main(){

	char a[105];

	char b[105];

	scanf("%s %s",a,b);

	int lena = strlen(a);

	int lenb = strlen(b);

	if(lena > lenb) printf("GREATER\n");

	else if(lena < lenb) printf("LESS\n");

	else{

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

			if(a[i] == b[i] && i == lena-1){

				printf("EQUAL\n");

				break;

			}

			if(a[i] > b[i]){

				printf("GREATER\n");

				break;

			}

			if(a[i] < b[i]){

				printf("LESS\n");

				break;

			}

		}

	}

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>



using namespace std;



int main(){

	char s[205];

	char s1[205];

	int a[205];

	int b[205];

	int flag = 0;

	scanf("%s%s",s,s1);

	int len = strlen(s);

	int len1 = strlen(s1);

	if(len > len1) printf("GREATER\n");

	else if(len < len1) printf("LESS\n");

	else if(len == len1){

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

			a[i] = s[i] - '0';

			}

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

			b[i] = s1[i] - '0';

			}

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

			if(a[i] > b[i]){

				flag = 1;

				printf("GREATER\n");

				break;

			}			

			else if(a[i] < b[i]){

				flag = 1;

				printf("LESS\n");

				break;

				}

		}

		if(flag == 0) printf("EQUAL\n");

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#define ll long long int

#define sz  200010

using namespace std;





string ss[sz];



int main()

{



    string a,b;

    ll x,y;



    cin>>a>>b;

    x=a.length();

    y=b.length();





    if(x>y)

        cout<<"GREATER"<<endl;

    else if(x<y)

        cout<<"LESS"<<endl;

    else

    {





        for(ll i=0; i<x; i++)

        {

            if(a[i]>b[i])

            {

                cout<<"GREATER"<<endl;

                return 0;

            }

            else if(a[i]<b[i])

            {

                cout<<"LESS"<<endl;

                return 0;

            }

        }



        cout<<"EQUAL"<<endl;

    }



    return 0;

}




// Optimized solution to the same problem (faster):
#include<bits/stdc++.h>

#define ll long long

#define nl "\n"

#define pi acos(-1)

#define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)

#define pcase printf("Case %d:\n",ca)

int ca=1;

using namespace std;



int main(){

    string a,b;

    cin>>a;

    cin>>b;

    if(a.size()>b.size()){

        cout<<"GREATER"<<nl;

    }else if(b.size()>a.size()){

        cout<<"LESS"<<nl;

    }else{

    for(int i =0;i<a.size();i++){

        if(a[i]>b[i]){

            cout<<"GREATER"<<nl;

            

            return 0;

        }else if(a[i]<b[i]){

            cout<<"LESS"<<nl;

            return 0;

        }



    }

    cout<<"EQUAL"<<nl;

}

  

} 

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main()

{

    long double  A,B;

    cin>>A>>B;

    if(A>B)

        cout<<"GREATER";

    else

        if(A<B)

        cout<<"LESS";

    else

    if(A==B)

        cout<<"EQUAL";





}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

int main()

{

	char a[1000],b[1000];

	scanf("%s %s",&a,&b);

	int la=strlen(a);

	int lb=strlen(b);

	if(la>lb) printf("GREATER\n");

	else if(la<lb) printf("LESS\n");

	else{

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

		        if(a[i]>b[i]){

		        	printf("GREATER\n");break;

				}

		        if(a[i]<b[i]){

		        	printf("LESS\n");break;

				}

		        if(a[i]==b[i]){

                   if(i==la-1 && a[i]==b[i])

		        	  printf("EQUAL\n");

		           else continue;

				}

		}

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

using namespace std;

int main()

{

	long double a,b;

	cin>>a>>b;

	if(a>b)

	{

		cout<<"GREATER";

	}

	else if(a<b)

	{

		cout<<"LESS";

	}

	else

	{

		cout<<"EQUAL";

	}

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

int main()

{

	char a[1000],b[1000];

	scanf("%s %s",&a,&b);

	int la=strlen(a);

	int lb=strlen(b);

	if(la>lb) printf("GREATER\n");

	else if(la<lb) printf("LESS\n");

	else{

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

		        if(a[i]>b[i]){

		        	printf("GREATER\n");break;

				}

		        if(a[i]<b[i]){

		        	printf("LESS\n");break;

				}

		        if(a[i]==b[i]){

                   if(i==la-1 && a[i]==b[i])

		        	  printf("EQUAL\n");

		           else continue;

				}

		}

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <cstdio>

#include <string>

#include <iostream>

using namespace std;

string a, b;

int main()

{

	cin >> a >> b;

	if(a.length() > b.length())

		printf("GREATER\n");

	else if(a.length() < b.length())

		printf("LESS\n");

	else

	{

		if(a > b)		

			printf("GREATER\n");

		if(a < b)

			printf("LESS\n");

		if(a == b)

			printf("EQUAL\n");

	}

	return 0;	

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

int main()

{

	char a[1000],b[1000];

	scanf("%s %s",&a,&b);

	int la=strlen(a);

	int lb=strlen(b);

	if(la>lb) printf("GREATER\n");

	else if(la<lb) printf("LESS\n");

	else{

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

		        if(a[i]>b[i]){

		        	printf("GREATER\n");break;

				}

		        if(a[i]<b[i]){

		        	printf("LESS\n");break;

				}

		        if(a[i]==b[i]){

                   if(i==la-1 && a[i]==b[i])

		        	  printf("EQUAL\n");

		           else continue;

				}

		}

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream> 

#include <string>

using namespace std;



string arr;

char s[100],n=1;

int main(){

	cin>>arr;

	s[0]=arr[0];

	for(int i=1;i<arr.length();i++){

		int fase=1; 

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

			if(arr[i]==s[j]){

				fase=0;

			} 

		}

		if(fase){

			s[n]=arr[i];

			n++; 

		}

	}

	if(n==2){

		cout<<"Yes";

	}else{

		cout<<"No";

	}

	return 0; 

} 

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>

#include<algorithm>

using namespace std;

char a[5];

int main()

{

	scanf("%s",a);

	int l=strlen(a);

	sort(a,a+4);

	if(a[0]==a[1]&&a[2]==a[3]&&a[0]!=a[2])printf("Yes\n");

	else printf("No\n");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#include <algorithm>

using namespace std;



int main(){

	char arr[4];

	

	cin>>arr;

	

	sort(arr,arr+4);

	

	if(arr[0]!=arr[2] && arr[0]==arr[1] && arr[2]==arr[3]){

		printf("Yes");

	}else{

		printf("No");

	}

	

	

	return 0;

}









































 

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>

#include<algorithm>

using namespace std;

char a[5];

int main()

{

	scanf("%s",a);

	int l=strlen(a);

	sort(a,a+4);

	if(a[0]==a[1]&&a[2]==a[3]&&a[0]!=a[2])printf("Yes\n");

	else printf("No\n");

}

// Fastest known solution for this problem: