#include <iostream>
#include <regex>
using namespace std;
int main() {
string str;
getline(cin, str);
regex e("a+\\s+b+");
if (regex_match(str,e))
cout<<"Matched";
else
cout<<"No Match";
return 0;
}
ICAgICNpbmNsdWRlIDxpb3N0cmVhbT4KICAgICNpbmNsdWRlIDxyZWdleD4KICAgIHVzaW5nIG5hbWVzcGFjZSBzdGQ7CiAKICAgIGludCBtYWluKCkgewogICAgICAgIHN0cmluZyBzdHI7CiAgICAgICAgZ2V0bGluZShjaW4sIHN0cik7CiAKICAgICAgICByZWdleCBlKCJhK1xccytiKyIpOwoKICAgICAgICBpZiAocmVnZXhfbWF0Y2goc3RyLGUpKSAKICAgICAgICAgICAgY291dDw8Ik1hdGNoZWQiOwogICAgICAgIGVsc2UKICAgICAgICAgICAgY291dDw8Ik5vIE1hdGNoIjsKICAgICAgICByZXR1cm4gMDsKICAgIH0K