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

int sum(int x){
    int sum = 0;
    for(int j = 1; j < x ;j++){
        if(x % j == 0) sum = sum + j;
    }
    return sum;
}

int main() {

    vector<int> perfect; //完数
    vector<int> abundant; //盈数

    for (int i = 2; i <= 60; i++) {
        if (i == sum(i)) {
            perfect.push_back(i);
        } else if (i < sum(i)) {
            abundant.push_back(i);
        }
    }

    printf("E:");
    for(int i = 0 ; i < perfect.size(); i++) printf(" %d", perfect[i]);

    printf("\nG:");
    for(int i = 0 ; i < abundant.size(); i++) printf(" %d", abundant[i]);

    return 0;
}