#include <iostream>
#include <regex>
#include <string>
#include <vector>

bool reg_match_all(const std::regex& r, const std::string& s, std::vector<std::vector<std::string>>& v) {
   for (std::sregex_iterator ri(s.begin( ), s.end( ), r), rf; ri != rf; ++ri) {
      v.push_back(std::vector<std::string>(ri->begin( ), ri->end( )));
   }
   return !v.empty( );
}

int main( ) {
   std::string s;
   std::regex r(R"((\d+)([a-z]?))");
   while (std::getline(std::cin, s)) {
      std::vector<std::vector<std::string>> matches;
      if (reg_match_all(r, s, matches)) {
         for (std::vector<std::string> niveles : matches) {
            std::cout << "--- Match:\n";
            for (int i = 0; i < niveles.size( ); ++i) {
               std::cout << "nivel " << i << ": " << niveles[i] << "\n";
            }
         }
      } else {
         std::cout << "0\n";
      }
      std::cout << "\n";
   }
}

/* Ejemplo de entrada:
hola 123x gatito perrito 456 789f uam 23 compiladores
:) :( 4563w vbnx 5466wwww vbnx
*/
