// ACSL2 String Differences.cpp 
#include 
#include 
using namespace std;

string DeleteChar(string str)
{
    int b = str.length()-1,i=0;
    while (i str2.length())
            a = str2.length() - 1;
        else
            a = str1.length() - 1;
        i++;
    } while (i <= a);
    *one = str1; *two = str2;
    return (*one, *two);
}

string RemoveRightToLeft(string *one, string *two)
{
    string str1 = *one; string str2 = *two;
    int a = string(str1).length()-1,b= string(str2).length() - 1,i=0;
        if (a > b)
        {
            do
            {
                if (str1.at(a - i) == str2.at(b - i))
                {
                    str1.erase(a-i,1);
                    str2.erase(b-i, 1);
                    a--;    b--;
                    i--;
                }
                i++;
            } while (i < b);     
        }
        else if (a < b)
        {
            do
            {
                if (str1.at(a - i) == str2.at(b - i))
                {
                    str1.erase(a-i,1);
                    str2.erase(b-i, 1);
                    a--;    b--;
                    i--;
                }
                i++;
            } while (i < a);
        }
    *one = str1;    *two = str2;
    return (*one,*two);
}

void CompareString(string str1, string str2)
{
        if (str1.compare(str2) > 0)
            cout << str2 << endl;
        if (str1.compare(str2) < 0)
            cout << str1 << endl;
}

int main()
{
    string A[5], B[5];
    for (int i = 0; i < 5; i++)
    {
        cin >> A[i];   cin >> B[i];

        //Delete double alphabet
        A[i] = DeleteChar(A[i]);
        B[i] = DeleteChar(B[i]);

        //Delete vowels
        A[i] = DeleteVowels(A[i]);
        B[i] = DeleteVowels(B[i]);

        //Delete like positions
        RemoveLeftToRight(&A[i], &B[i]);

        //Delete like positions from right to left
        RemoveRightToLeft(&A[i], &B[i]);
    
    }
    for (int i = 0; i < 5; i++)
    {
        //print string
        cout << i +1<< ". ";
        if (A[i].length() > B[i].length())
            cout << B[i] << endl;
        else if (A[i].length() < B[i].length())
            cout << A[i] << endl;
        else
            CompareString(A[i], B[i]);
    }
    return 0;
}