#include <iostream>
#include <unordered_map>
#include <algorithm>
#include <string>

struct text
{
    text() = default;
    text(const std::string& txt) : data(txt) {}

    std::string key() const { std::string k(data); std::sort(k.begin(), k.end()); return k; }

    operator std::pair<std::string, std::string>() const { return std::make_pair(key(), data); }

    std::string data;
};

std::istream& operator>>(std::istream& is, text& t)
{
    return is >> t.data;
}

std::ostream& operator<<(std::ostream& os, const text& t)
{
    return os << t.data;
}

std::string quoted(const text& t)
{
    return std::string(1, '"') + t.data + '"';
}

int main()
{
    using pair_type = std::pair<std::string, std::string> ;

    std::unordered_map<std::string, std::string> map =
    { 
        pair_type(text("scooby")), pair_type(text("shaggy")),  pair_type(text("veronica")),
        pair_type(text("fred")),   pair_type(text("daphne")),  pair_type(text("wilma")),
        pair_type(text("betty")),  pair_type(text("barney")),  pair_type(text("dino")),
        pair_type(text("bambam")), pair_type(text("pebbles")), pair_type(text("george"))
    };

    text t;

    while (std::cin >> t)
    {
        auto it = map.find(t.key());
        if (it != map.end())
            std::cout << quoted(t) << " matches " << quoted(it->second) << '\n';
        else
            std::cout << quoted(t) << " matches nothing\n";
    }
}