import java.util.Scanner;
import java.math.*;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
// 注意 hasNext 和 hasNextLine 的区别
String x1 = in.next();
int k1 = in.nextInt();
String x2 = in.next();
int k2 = in.nextInt();
StringBuilder res1 = new StringBuilder();
StringBuilder res2 = new StringBuilder();
for(int i=0;i<k1;i++){
res1.append(x1);
}
for(int i=0;i<k2;i++){
res2.append(x2);
}
BigInteger r1 = new BigInteger(res1.toString());
BigInteger r2 = new BigInteger(res2.toString());
int flag = r1.compareTo(r2);
if(flag==1){
System.out.println("Greater");
}else if(flag==0){
System.out.println("Equal");
}else{
System.out.println("Less");
}
}
}