#include <iostream>
#include <cmath>
#include <string>
using namespace std;
int main()
{
unsigned long long int n = 21;
unsigned long long int z = 0;
unsigned long long int count = 0;
string line;
unsigned short int a=0, b=0, flag=0;
for ( unsigned long long int k = 0; k<n; k++ ) {
z = pow(10, k);
count = 0;
for (unsigned long long int i = z; i<z*10; i++) {
flag = 0;
line = to_string(i);
for (unsigned short int j = 0; j < line.length()-1; j++ ) {
a = line[j];
b = line[j+1];
if ( abs(a - b) > 1 ) {
flag++;
break;
}
}
if ( !flag ) count++;
}
cout << (k+1) << "=" << count << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CiNpbmNsdWRlIDxzdHJpbmc+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKQp7CiAgICB1bnNpZ25lZCBsb25nIGxvbmcgaW50IG4gPSAyMTsKICAgIHVuc2lnbmVkIGxvbmcgbG9uZyBpbnQgeiA9IDA7CiAgICB1bnNpZ25lZCBsb25nIGxvbmcgaW50IGNvdW50ID0gMDsKICAgIHN0cmluZyBsaW5lOwogICAgdW5zaWduZWQgc2hvcnQgaW50IGE9MCwgYj0wLCBmbGFnPTA7CiAgICBmb3IgKCB1bnNpZ25lZCBsb25nIGxvbmcgaW50IGsgPSAwOyBrPG47IGsrKyApIHsKICAgIAogICAgICAgIHogPSBwb3coMTAsIGspOwogICAgICAgIGNvdW50ID0gMDsKICAgICAgICBmb3IgKHVuc2lnbmVkIGxvbmcgbG9uZyBpbnQgaSA9IHo7IGk8eioxMDsgaSsrKSB7CiAgICAgICAgICAgIGZsYWcgPSAwOwogICAgICAgICAgICBsaW5lID0gdG9fc3RyaW5nKGkpOwogICAgICAgICAgICBmb3IgKHVuc2lnbmVkIHNob3J0IGludCBqID0gMDsgaiA8IGxpbmUubGVuZ3RoKCktMTsgaisrICkgewogICAgICAgICAgICAgICAgYSA9IGxpbmVbal07CiAgICAgICAgICAgICAgICBiID0gbGluZVtqKzFdOwogICAgICAgICAgICAgICAgaWYgKCBhYnMoYSAtIGIpID4gMSApIHsKICAgICAgICAgICAgICAgICAgICBmbGFnKys7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKCAhZmxhZyApIGNvdW50Kys7IAogICAgICAgIH0KICAgICAgICBjb3V0IDw8IChrKzEpIDw8ICI9IiA8PCBjb3VudCA8PCBlbmRsOwogICAgfQogICAKICAgcmV0dXJuIDA7Cn0=