#include <iostream>
#include <string>
static const std::string chars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\
789");
template<int n>
void pp(const std::string& p)
{
for (std::string::const_iterator i = chars.begin();
i != chars.end(); ++i)
pp<n-1>(p + *i);
}
template<> void pp<1>(const std::string& p)
{
for (std::string::const_iterator i = chars.begin();
i != chars.end(); ++i)
std::cout << p + *i << std::endl;
}
int main(int, char **)
{
pp<3>("");
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgpzdGF0aWMgY29uc3Qgc3RkOjpzdHJpbmcgY2hhcnMoImFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVowMTIzNDU2XAo3ODkiKTsKCgp0ZW1wbGF0ZTxpbnQgbj4Kdm9pZCBwcChjb25zdCBzdGQ6OnN0cmluZyYgcCkKewogICAgZm9yIChzdGQ6OnN0cmluZzo6Y29uc3RfaXRlcmF0b3IgaSA9IGNoYXJzLmJlZ2luKCk7CiAgICAgICAgIGkgIT0gY2hhcnMuZW5kKCk7ICsraSkKICAgICAgcHA8bi0xPihwICsgKmkpOwp9CnRlbXBsYXRlPD4gdm9pZCBwcDwxPihjb25zdCBzdGQ6OnN0cmluZyYgcCkKewogICAgZm9yIChzdGQ6OnN0cmluZzo6Y29uc3RfaXRlcmF0b3IgaSA9IGNoYXJzLmJlZ2luKCk7CiAgICAgICAgIGkgIT0gY2hhcnMuZW5kKCk7ICsraSkKICAgICAgc3RkOjpjb3V0IDw8IHAgKyAqaSA8PCBzdGQ6OmVuZGw7Cn0KaW50IG1haW4oaW50LCBjaGFyICoqKQp7CiAgICBwcDwzPigiIik7Cn0K