#include<cstdio>
#include<vector>
using namespace std;
vector<int>vec1;
vector<int>vec2;
int main(){
	for (int i = 1; i < 61; i++){
		int sum=0;
		for (int j = 1; j < i; j++){
			if (i%j == 0){
				sum = sum + j;
			}
		}
		if (i == sum){
			vec1.push_back(i);
		}
		else if (i < sum){
			vec2.push_back(i);
		}
	}
	printf("E:");
	for (int i = 0; i < vec1.size(); i++){
		printf(" %d", vec1[i]);
	}
	printf("\nG:");
	for (int i = 0; i < vec2.size(); i++){
		printf(" %d", vec2[i]);
	}
}