#include <bits/stdc++.h>
typedef struct Tree {
  long long mlKey;
  int mi1Height[2];
  struct Tree *mzp1Child[2];
} Tree;
static FILE *szpFpI;
static int siK;
static Tree sz1Tree[10000];
static int siTCnt;
static Tree *szpTop;
int fOutLine(char *pcpLine) {
  char lc1Buf[1024];
  printf("%s", pcpLine);
  return 0;
}
Tree *fTreeMake(long long plKey) {
  Tree *lzpTree = &(sz1Tree[siTCnt]);
  siTCnt++;
  memset(lzpTree, 0, sizeof(Tree));
  lzpTree->mlKey = plKey;
  return lzpTree;
}
int fTreeCmp(Tree *pzpTree, long long plKey) {
  if (plKey < pzpTree->mlKey) {
    return -1;
  } else if (plKey > pzpTree->mlKey) {
    return 1;
  }
  return 0;
}
int fTreeGetHeight(Tree *pzpTree) {
  if (pzpTree == NULL) {
    return 0;
  }
  if (pzpTree->mi1Height[0] >= pzpTree->mi1Height[1]) {
    return pzpTree->mi1Height[0] + 1;
  } else {
    return pzpTree->mi1Height[1] + 1;
  }
}
int fTreeRttR(Tree **pzppTree) {
  Tree *lzpChild = (*pzppTree)->mzp1Child[0];
  (*pzppTree)->mzp1Child[0] = lzpChild->mzp1Child[1];
  (*pzppTree)->mi1Height[0] = lzpChild->mi1Height[1];
  lzpChild->mzp1Child[1] = *pzppTree;
  lzpChild->mi1Height[1] = fTreeGetHeight(*pzppTree);
  *pzppTree = lzpChild;
  return 0;
}
int fTreeRttL(Tree **pzppTree) {
  Tree *lzpChild = (*pzppTree)->mzp1Child[1];
  (*pzppTree)->mzp1Child[1] = lzpChild->mzp1Child[0];
  (*pzppTree)->mi1Height[1] = lzpChild->mi1Height[0];
  lzpChild->mzp1Child[0] = *pzppTree;
  lzpChild->mi1Height[0] = fTreeGetHeight(*pzppTree);
  *pzppTree = lzpChild;
  return 0;
}
int fTreeComAddDel(Tree **pzppNow, int piWay) {
  int liNew = fTreeGetHeight((*pzppNow)->mzp1Child[piWay]);
  if ((*pzppNow)->mi1Height[piWay] == liNew) {
    return 0;
  }
  (*pzppNow)->mi1Height[piWay] = liNew;
  if ((*pzppNow)->mi1Height[0] - (*pzppNow)->mi1Height[1] > 1) {
    fTreeRttR(pzppNow);
  } else if ((*pzppNow)->mi1Height[1] - (*pzppNow)->mi1Height[0] > 1) {
    fTreeRttL(pzppNow);
  }
  return 1;
}
int fTreeAdd(Tree **pzppNow, long long plKey) {
  if (*pzppNow == NULL) {
    *pzppNow = fTreeMake(plKey);
    return 1;
  }
  int liRet = fTreeCmp(*pzppNow, plKey);
  if (liRet == 0) {
    return -1;
  }
  int liWay;
  if (liRet < 0) {
    liWay = 0;
  } else {
    liWay = 1;
  }
  liRet = fTreeAdd(&((*pzppNow)->mzp1Child[liWay]), plKey);
  if (liRet < 1) {
    return liRet;
  }
  return fTreeComAddDel(pzppNow, liWay);
}
int fTreeOut(Tree *pzpNow) {
  char lc1Buf[1024];
  if (pzpNow == NULL) {
    return 0;
  }
  fTreeOut(pzpNow->mzp1Child[0]);
  if (siK > 0) {
    siK--;
    sprintf(lc1Buf, "%lld\n", pzpNow->mlKey);
    fOutLine(lc1Buf);
  }
  fTreeOut(pzpNow->mzp1Child[1]);
  return 0;
}
int fValGet(int *pipVal, int piENo, long long *plpN, double *pdpVal) {
  int i;
  *plpN = 0;
  long long llRate = 1;
  int liSum = 0;
  for (i = piENo; i >= 0; i--) {
    *plpN += (long long)pipVal[i] * llRate;
    llRate *= 10;
    liSum += pipVal[i];
  }
  *pdpVal = (double)*plpN / (double)liSum;
  return 0;
}
int fValReg(int *pipMin, int *pipMax, int piSNo, int piENo) {
  int i;
  long long llNMax;
  double ldVMax;
  fValGet(pipMax, piENo, &llNMax, &ldVMax);
  for (i = pipMin[piSNo]; i < pipMax[piSNo]; i++) {
    int li1Now[20];
    memcpy(li1Now, pipMax, sizeof(li1Now));
    li1Now[piSNo] = i + 1;
    long long llNNow;
    double ldVNow;
    fValGet(li1Now, piENo, &llNNow, &ldVNow);
    if (ldVNow > ldVMax) {
      break;
    }
    if (piSNo == piENo) {
      fTreeAdd(&szpTop, llNNow);
      continue;
    }
    int li1Min[20];
    memcpy(li1Min, pipMin, sizeof(li1Min));
    li1Min[piSNo] = i;
    fValReg(li1Min, li1Now, piSNo + 1, piENo);
  }
  fTreeAdd(&szpTop, llNMax);
  return 0;
}
int fMain() {
  int i;
  char lc1Buf[1024];
  fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
  sscanf(lc1Buf, "%d", &siK);
  fTreeAdd(&szpTop, 1);
  int li1Min[20], li1Max[20];
  li1Min[0] = 1;
  li1Max[0] = 9;
  for (i = 1; siK > siTCnt; i++) {
    fValReg(li1Min, li1Max, 0, i - 1);
    li1Min[i] = 1;
    li1Min[i - 1] = 0;
    li1Max[i] = 9;
  }
  fTreeOut(szpTop);
  return 0;
}
int fOne() {
  int liRet;
  char lc1Buf[1024];
  siTCnt = 0;
  szpTop = NULL;
  szpFpI = stdin;
  liRet = fMain();
  return 0;
}
int main() {
  fOne();
  return 0;
}
