#include using namespace std; using ll=long long; vector> vp={ {-1,-1}, {1,2}, {2,3}, {1,3}, {4,5}, {2,4}, {1,4}, {3,5}, {8,9}, {2,5}, {1,5}, {5,7}, {3,6}, {6,8}, {2,6}, {1,6}, {9,14}, {8,10}, {3,7}, {8,12}, {2,7}, {1,7}, {4,8}, {18,23}, {7,10}, {3,8}, {5,9}, {2,8}, {1,8}, {10,18}, {4,9}, {6,11}, {6,12}, {3,9}, {6,13}, {2,9}, {1,9}, {5,12}, {9,18}, {4,10}, {4,11}, {4,12}, {3,10}, {3,11}, {2,10}, {1,10}, {1,11}, {1,12}, {2,13}, {1,13}, {4,15}, {2,14}, {1,14}, {3,15}, {8,19}, {2,15}, {1,15}, {5,17}, {3,16}, {6,18}, {2,16}, {1,16}, {12,26}, {8,20}, {3,17}, {8,21}, {2,17}, {1,17}, {4,18}, {8,23} }; void solve(){ ll n; cin>>n; auto f=[&](ll x){ ll ret=0; while (x){ ret=max(ret,x%10); x/=10; } return ret; }; if (n<64){ auto [l,r]=vp[n]; r--; cout<>t; while (t--) solve(); }