#include using namespace std; #define rep(i,n) for(int i=0; i; using TU = tuple; using vint = vector; using vvint = vector; using vvvint = vector; using vll = vector; using vvll = vector; using vvvll = vector; template istream &operator>>(istream &is,vector &v){for(T &in:v){is>>in;}return is;} template ostream &operator<<(ostream &os,vector &v){for(int i=0;i<(int)v.size();i++){os< istream &operator>>(istream &is,vector> &v){for(vector &in:v){is>>in;}return is;} template ostream &operator<<(ostream &os,vector> &v){for(vector &out:v){os<>n; queue q; for(int a=1;a<=9;a++){ for(int b=a+1;b<=9;b++){ string add=""s; q.push(add+to_string(a)+to_string(b)); } } string res=""s; rep(i,n) { res=q.front(); q.pop(); q.push(res+res[res.size()-1]); } cout<< res <<'\n'; return 0; }