#include <stdio.h>
#include <string.h>
#include <ctype.h>

int isValid(char str[]) {
    int len = strlen(str);
    if (len < 1 || len > 10) {
        return 0; // violates length rule
    }
    for (int i = 0; i < len; i++) {
        if (!isalpha(str[i])) {
            return 0; // invalid if not alphabet
        }
    }
    return 1;
}

void sortString(char str[]) {
    int n = strlen(str);
    for (int i = 0; i < n - 1; i++) {
        for (int j = i + 1; j < n; j++) {
            if (str[i] > str[j]) {
                char temp = str[i];
                str[i] = str[j];
                str[j] = temp;
            }
        }
    }
}

int main() {
    char str1[20], str2[20];

    scanf("%s", st