#include<stdio.h>
int perfect(int n);
int main() {
	//freopen("input.txt", "r", stdin);
	int n, j = 0, number = 19;
	scanf("%d", &n);
	while (n--) {
		while (perfect(number) != 10) {
			number += 9;
		}
		number += 9;
	}
	printf("%d\n", number - 9);
	return 0;
}
int perfect(int n) {
	int sum = 0;
	while (n != 0) {
		sum += n % 10;
		n = n / 10;
	}
	return sum;
}

#include<stdio.h>

typedef long long ll;
#define digit_cnt 19
#define  digit_sum 11

ll cnt[digit_cnt][digit_sum];

ll check(int pos,int num,int sum,int index)
{
	ll res = 0;
	for(int i=0 ; i<=num ; i++)
		res += cnt[pos-1][sum-i];
	if(res>=index)
		if(num==0)
			return 0;
		else
			return res-cnt[pos-1][sum-num];
	return -1;
}

ll power(int base,int exp,int offset)
{
	ll res = 1;
	for(int i=0 ; i<exp ; i++)
		res *= 10;
	return res*offset;
}

ll calc(int pos,int sum,int index)
{
	if(pos==1)
		return (ll)sum;
	for(int i=0 ; i<=sum && i<10 ; i++)
	{
		ll t = check(pos,i,sum,index);
		if(t>=0)
			return power(10,pos-1,i)+calc(pos-1,sum-i,index-t);
	}
}

void preprocess()
 {
 	for(int j=0 ; j<=10 ; j++)
		if(j==10) cnt[2][j] = 0;
		else cnt[1][j] = 1;

	for(int i=2 ; i<19 ; i++)
	{
		for(int j=0 ; j<=10 ; j++){
			for(int k=0 ; k<=j && k<10 ; k++)
				cnt[i][j] += cnt[i-1][j-k];
		}
	}
}

int main()
{
	preprocess();
	int k;
	scanf("%d",&k);
	printf("%lld\n",calc(18,10,k) );
	return 0;
}

#include<stdio.h>

typedef long long ll;
#define digit_cnt 19
#define  digit_sum 11

ll cnt[digit_cnt][digit_sum];

ll check(int pos,int num,int sum,int index)
{
	ll res = 0;
	for(int i=0 ; i<=num ; i++)
		res += cnt[pos-1][sum-i];
	if(res>=index)
		return res-cnt[pos-1][sum-num];
	return -1;
}

ll power(int base,int exp,int offset)
{
	ll res = 1;
	for(int i=0 ; i<exp ; i++)
		res *= 10;
	return res*offset;
}

ll calc(int pos,int sum,int index)
{
	if(pos==1)
		return (ll)sum;
	for(int i=0 ; i<=sum && i<10 ; i++)
	{
		ll t = check(pos,i,sum,index);
		if(t>=0)
			return power(10,pos-1,i)+calc(pos-1,sum-i,index-t);
	}
}

void preprocess()
 {
 	for(int j=0 ; j<=10 ; j++)
		if(j==10) cnt[2][j] = 0;
		else cnt[1][j] = 1;

	for(int i=2 ; i<19 ; i++)
	{
		for(int j=0 ; j<=10 ; j++){
			for(int k=0 ; k<=j && k<10 ; k++)
				cnt[i][j] += cnt[i-1][j-k];
		}
	}
}

int main()
{
	preprocess();
	int k;
	scanf("%d",&k);
	printf("%lld\n",calc(18,10,k) );
	return 0;
}

#include<stdio.h>
int main()
{
    int n;
    while(~scanf("%d",&n))
    {
        int sum,a,i,t=0;
        for(i=1;t<n;i++)
        {
            sum=0;
            a=i;
          while(a)
          {
              sum+=a%10;
              a=a/10;
          }
          if(sum==10)
          {
              t++;
          }
        }
        printf("%d\n",i-1);
    }

    return 0;
}

#include<stdio.h>

int main()
{
    int n,p,j;
    scanf("%d",&n);
    j=10;
    while(n)
    {
    j=j+9;
    p=sum(j);
    if(p==10)
    n--;
    }
    printf("%d",j);
    return 0;
}

int sum(int n)
{
int s=0;
while(n)
{
s=s+(n%10);
n=n/10;
}
return(s);
}

#include <stdio.h>
#include <stdlib.h>
long long somme(long long x)
{
    long long s=0 ;
    while(x)
    {
        s+=x%10 ;
        x=x/10 ;
        if(s>10)
            x=0 ;
    }
    return s ;
}
int main()
{
    long long x=10 ;
    int bo ;
    int k ;
    scanf("%d",&k) ;
    while(k!=0)
    {
        k-- ;
        bo=1 ;
        while(bo)
        {
            x+=9 ;
            if(somme(x)==10)
                bo=0 ;
        }
    }
    printf("%I64d",x) ;
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

long lol (long long x)
{
    long result = 0;
    while (x)
    {
        result += x % 10;
        x /= 10;
    }
    return result;
}
int main()
{
    unsigned long x;
    scanf("%ld", &x);
    long long result = 10;
    unsigned long temp = 0;
    while (temp < x)
    {
        result +=9;
        if (lol(result) == 10 )
        {
            temp++;
        }
    }
    printf("%lld\n", result);
    return 0;
}

#include<stdio.h>
int main()
{
	int i,j,n,a,count=0;
	scanf("%d",&n);
	i=19;
	while(i)
	{
		j=i;a=0;
		while(j)
		{
			a+=(j%10);
			j/=10;
		}
		if(a==10)
			count++;
		if(count==n)
			break;
		i++;
	}
	printf("%d",i);

}

#include<stdio.h>
int main(){
int k;
int i;
int s=0;
scanf("%d",&k);
for(i=19; ;i++){
    int j=i;
    while(j)
    {
        s+=j%10;
        j=j/10;
    }
    if (s==10)
        {

            k--;
        }
    if (k==0){
        printf("%d",i);
        break;
    }
    s=0;
}

return (0);
}

#include<stdio.h>
int sum_of_digit(int i)
{
    int k=0;
    while(i!=0)
    {
        k=k+i%10;
        i=i/10;
    }
    return k;
}
int main()
{
    int k,i,l=0;
    scanf("%d",&k);
    for(i=10;;i++)
    {
        if(sum_of_digit(i)==10)
        l++;
        if(k==l)
        break;
    }
    printf("%d",i);
    return 0;
}

#include<stdio.h>
int a[10000];

int check(int x){
	int q=x,s=0;
	while(q!=0){
		q=q/10;
		s+=(x%10);
		x=q;
	}
	if(s==10)
		return s;
	else
		return 0;
}

void make(){
	int c = 0,i;

	for(i=1;c<=10000;i=i+1){

		if(check(i)){
			c++;
			a[c] = i;
		}
	}

}

int main(){

	int n;

	scanf("%d",&n);

	make();
	printf("%d\n",a[n]);

	return 0;
}

#include <stdio.h>
int sum(int a){int s=0;
    while(a!=0){
        s+=a%10;
        a/=10;
    }return s;
}
int main(){
    int k;
    scanf("%d",&k);
    int a=1;
    while(k!=0){
        a++;
        if(sum(a)==10)
        k--;
    }
    printf("%d",a);
    return 0;
}

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

int sm(int n)
{
    int sum = 0;
    while(n) {sum += n % 10; n /= 10;}
    return sum;
}
int main()
{
    int n, t = 19;
    scanf("%d", &n);
    while(1)
    {

        if(sm(t) == 10) n--;
        if(n == 0) break;
        t++;
    }
    printf("%d", t);
	return 0;
}

#include<stdio.h>

int findNth(int n)
{
    int count = 0;

    for (int curr = 19;; curr+=9) {

        // Find sum of digits in current no.
        int sum = 0;
        for (int x = curr; x > 0; x = x / 10)
            sum = sum + x % 10;

        // If sum is 10, we increment count
        if (sum == 10)
            count++;

        // If count becomes n, we return current
        // number.
        if (count == n)
            return curr;
    }
    return -1;
}

int main() {
	int n;
	scanf("%d",&n);
    printf("%d\n", findNth(n));
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int digit(int n)
{
   int ans=0;
   while(n>0)
    {
        ans+=n%10;
        n/=10;
    }
   return ans;
}
int main()
{
    int k,n,ans;
    n=18;
    scanf("%d",&k);
    while(k)
    {
        n++;
        if(digit(n)==10)
        {
            ans=n;
            k--;
        }
    }
    printf("%d\n",ans);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
long i=1;
long m=0;
long k;
scanf("%ld",&k);
while(m < k){
    int s=0;
    long j=i;
    while(j >= 10){
        s=s+(j % 10);
        j=j/10;
        }
    s=s+j;
    if(s != 10){
        i++;}
    else{i++;
        m++;}
    }

printf("%ld",i-1);

    return 0;
}

#include<stdio.h>
int digit(int n){
int ans=0;
while(n>0){
    ans+=n%10;
    n/=10;
}
return ans;
}

int main()
{
    int k,n=18,ans;
    scanf("%d\n",&k);
    while(k){
            n++;
    if(digit(n)==10){
        ans=n;
        k--;
    }
}
printf("%d\n",n);
return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    long long int t,m,n=19,l=0,k=1;
    scanf("%lli",&t);
        while(k!=t){
            n+=9;
          m=n;
          while(m!=0){
            l+=m%10;
            m=m/10;
          }
          if(l==10)  {
            k++;
          }
          l=0;
        }
       printf("%lli",n);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int sum_digits(int n) {
	int sum = 0;
	while (n > 0) {
		sum += n % 10;
		n /= 10;
	}
	return sum;
}

int main(int argc, char* argv[]) {
	int i, k, count;

	scanf("%i", &k);
	count = 0;
	for (i = 19; i < 11000000; i++) {
		if (sum_digits(i) == 10) {
			count++;
			if (count == k) {
				break;
			}
		}
	}
	printf("%d\n", i);
	return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    long k ;
    scanf("%ld",&k ) ;

    long long sa=18 ;
    long  long s ;
    long i = 0  ;
    int sm ;
    while (1)
    {
        sa=sa+1 ;
        s=sa;
        sm=0 ;
        while (1)
        {
            if (s/10==0)
            {

                sm=sm+s ;
                break ;
            }
            else
            {
                sm=sm+s%10 ;
                s=s/10;
            }
        }
        if (sm==10)
        {
            i++ ;
            if (i==k)
            {
               break ;
            }

        }
    }
    printf("%lld",sa) ;
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int perfect(int n)
{int test=0;
    int s=0;
int i=0;

    s=n/10;
i=i+n%10;

while(s!=0)

{i=i+s%10;

    s=s/10;
}
if(i==10)
    test=1;
return test;
}
int main()
{int  k;
scanf("%d",&k);
int i=1;
int test=0;
int numparfait=0;
while(numparfait!=k)
{
    test=perfect( i);
    if(test)
    {
        numparfait++;
    }
       i++;

}
    printf("%d",i-1);

    return 0;
}

#include<stdio.h>
int sum(int n);
int main()
{
    int k;
    scanf("%d",&k);
    int set=0,count=0,n=1;
    while(count<k){
    int ans=sum(n);
    //printf("%d %d\n",ans,n);
    if(ans==10){
    count++;
        n++;
    }
    else
    n++;
    //printf("%d %d %d \n",ans,n,count);
    }
    printf("%d",n-1);

}
int sum(int n)
{
    int res=0;
    while(n>=1)
    {
        res+=n%10;
        n=n/10;
    }
    return res;
}

#include<stdio.h>
int dsum(int n)
{
	int sum=0;
	while(n>0)
	{
		sum+=n%10;
		n=n/10;
	}
	return sum;
}
int main()
{
	int k,count=0;
	scanf("%d",&k);
	int n=18;
	while(count<k)
	{
		n++;
		if(dsum(n)==10)
		{
			count++;
		}
	}
	printf("%d\n",n);
	return 0;
}

#include<stdio.h>
int main()
{
    int m,z,count=0,sum;
    long long int i,a;
    scanf("%d",&m);
    for (i=19;i<1000000000;i++)
    {
        sum=0;
        a=i;
        while(a!=0)
        {
            sum = sum + a%10;
            a= a/10;
        }

        if(sum==10)
        {
            count++;
            if(count==m)

            {
                printf("%d ",i);
                return 0;
            }

        }
    }
}

#include<stdio.h>
int n,i,c;
int f(int n){
	if(n==0)return 0;
	return n%10+f(n/10);
}
int main(){
	scanf("%d",&n);
	while(1){
		i++;
		if(f(i)==10)c++;
		if(c==n){
			printf("%d",i);
			return 0;
		}
	}
}

#include<stdio.h>
#include<ctype.h>
int main()
{
    int x,len=0,nb=0,res,a;
    int y=19;
    scanf("%d",&x);
    while(nb!=x)
    {
        len=0;
        a=y;
    while(a)
    {
        len+=a%10;
        a=a/10;
    }
    if(len==10 )
    {
        nb++;
    }
    y++;
    }
    printf("%d",y-1);
    return 0;
}

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int x,y,s=0,c=0,z=19;
    scanf("%d",&x);
    while(c!=x)
    {
        y=z;
    while(y>0)
    {
        s=s+y%10;
        y=y/10;
    }
    if(s==10)
    {
        c++;
    }
    s=0;
    z++;
    }
    printf("%d\n",z-1);

}

#include <stdio.h>

int findNth(int n)
{
	int count = 0;

	for (int curr = 19;; curr += 9) {

		// Find sum of digits in current no.
		int sum = 0;
		for (int x = curr; x > 0; x = x / 10)
			sum = sum + x % 10;

		// If sum is 10, we increment count
		if (sum == 10)
			count++;

		// If count becomes n, we return current
		// number.
		if (count == n)
			return curr;
	}
	return -1;
}

int main()
{
	int k;
	scanf("%d",&k);
	printf("%d\n", findNth(k));
	return 0;
}

#include<stdio.h>

int sum_of_digits (int x){
    int sum=0,rem=0;
    while (x>0){
    rem=x%10;
    sum+=rem;
    x/=10;
               }
    return sum;
                         }

int main (){
    int k ,i=19;
    scanf("%d",&k);

    while(k>0){
    if(sum_of_digits(i)==10)  k--;
    i++;
              }
    printf("%d",i-1);
    return 0;
            }

#include<stdio.h>
int main()
{
    long long k,i,n,sum,count=0;
    scanf("%lld",&k);
    for(n=19;;n+=9){
            sum=0;
            i=n;
        while(i!=0){
           sum+=i%10;
           i/=10;}
        if(sum==10)
            count++;
        if(count==k)
            break;
    }
    printf("%lld\n",n);
}

#include<stdio.h>
int t,stop=0;
void f(int k,int n,int s[10]){
	if(stop)return;
	if(n==8){
		if(k!=10)return;
		if(t!=0){
			t--;
			return;
		}
		stop=1;
		int num=0;
		for(int i=0;i<n;i++){
			num*=10;
			num+=s[i];
		}
		printf("%d\n",num);
		return;
	}

	int end=9;
	if(end>10-k)end=10-k;

	for(int i=0;i<=end;i++){
		s[n]=i;
		f(k+i,n+1,s);
	}
}

int main(){
	scanf("%d",&t);
	t--;
	int s[10]={0};
	f(0,0,s);
}

#include <stdio.h>
#include <stdlib.h>

int counter = 0, sum;

void solve(int n) {
    sum = 0;
    while (n > 0) {
        sum += (n % 10);
        n /= 10;
    }
    if (sum == 10) counter++;
}

int main() {
    int i, num;
    scanf("%d", &num);
    for (i = 1; ; i++) {
        if (counter != num) solve(i);
        else printf("%d\n", i - 1), exit(0);
    }
    return 0;
}

#include <stdio.h>

int main()
{
    int n,c=1,x=19,temp2,temp;
    scanf("%d",&n);
    if(n==1)
    {
        printf("%d",x);
        return 0;
    }
    x=x+9;
    while(1)
    {
        temp=x;
        temp2=0;
        while(temp!=0)
        {
            temp2+=temp%10;
            temp/=10;
        }
        if(temp2==10)
        {
                c++;
            if(c==n)
            {
                printf("%d",x);
                break;
            }
        }
        x=x+9;
    }

}

#include <stdio.h>

int cub[100000];
int main(){
    int perfects[10000];
    perfects[0]=19;
    int cont=1, x=19, pos=1;
    while(cont!=10000){
        x+=9;
        int y=x, sum=0;
        while(y>0){
            sum+=y%10;
            y/=10;
        }
        if(sum==10){
            perfects[pos]=x;
            pos++;
            cont++;
        }
    }
    int n;
    scanf("%d", &n);
    int ini=0,fin=n-1,med;
    while(ini<fin){
        med=((ini+fin)/2)+1;
        if(med>n) fin=med-1;
        else ini=med;
    }
    printf("%d", perfects[ini]);
return 0;
}

#include <stdio.h>

int cub[100000];
int main(){
    int perfects[10000];
    perfects[0]=19;
    int cont=1, x=19, pos=1;
    while(cont!=10000){
        x+=9;
        int y=x, sum=0;
        while(y>0){
            sum+=y%10;
            y/=10;
        }
        if(sum==10){
            perfects[pos]=x;
            pos++;
            cont++;
        }
    }
    int n;
    scanf("%d", &n);
    printf("%d", perfects[n-1]);
return 0;
}

#include<stdio.h>
int main()
{
    int n,s,r,temp,count=0,i;
    scanf("%d",&n);
    for(i=18;i<=100000000;i++)
    {  s=0;
        temp=i;
        while(temp!=0)
        {
            r=temp%10;
            s=s+r;
            temp=temp/10;
        }
        if(s==10)
        {
            count++;
        }
        if(count==n)
        {
            break;
        }
    }
    printf("%d",i);

}

//Bismillahir Rahmanir Rahim
#include<stdio.h>
int main()
{
    int x;
    scanf("%d", &x);
    int i;
    int t;
    int count = 0;
    int remainder;
    int sum;
    for(i = 19; ;i++){
        sum = 0;
        t = i;
        while(t != 0){
            remainder = t % 10;
            sum = remainder + sum;
            t = t / 10;
        }

        if(sum == 10){
            count++;
        }
        if(count == x){
            break ;
        }

    }

    printf("%d\n", i);

    return 0;
}
//Alhamdulillah!

#include<stdio.h>
int sommedigit(int n)
{
  int s=0,k;
  k=n;
  while(k!=0)
  {
    s += k%10;
    k = k/10;
  }
  return(s);
}
int main()
{
   int k,i,res=10,c=1,l=0,s=0;
   scanf("%d",&k);
   for(i=1;i<=k;i++)
   {
       res +=9;
       while (sommedigit(res)!=10)
           res+=9;
   }

   printf("%d",res);
}

#include<stdio.h>
#include<math.h>
int niilber(int a)
{
	int p,sum=0;
while(a>0)
{sum=sum+a%10;
a=a/10;

}
return sum;
}
int main()
{
	int k,n=1,i=1;
	scanf("%d",&k);
	while(i<=k)
	{
		n++;
		if(niilber(n)==10)
			i++;
	}
	printf("%d",n);
}

#include <stdio.h>

int main(){

	int n;
	scanf("%d",&n);
	int j = 1;
	int i = 0;
	int sum;
	int num;
	while(i < n){
		sum = 0;
		int temp = j;
		while((j != 0) && (sum < 20)){
			sum += j%10;
			j = j/10;
		}
		if(sum == 10){
			i++;
			num = temp;
		}
		j = temp + 1;
	}
	printf("%d",num);
}

#include<stdio.h>
int f(int a){
    int c,s=0;
    for(;a!=0;){
        c=a%10;
        a=a/10;
        s=s+c;
    }
    if(s==10){
        return 1;
    }
    else return 0;
}
int main(){
    int a,k=0,i;
    scanf("%d",&a);
    for(i=19;;i+=9){
        k=k+f(i);
        if(k==a){
            printf("%d",i);
            break;
            }
        }
    return 0;
}

#include<stdio.h>
#include<math.h>
#include<stdbool.h>
bool isperfect(int n)
{
    int sum=0;

    while(n>0)
    {
        sum=sum +n%10;
        n=n/10;
    }
    if (sum==10)return true;
    else return false;
}

main()
{
    int k,i,ctr=0;
        scanf("%d",&k);

    {
         for(i=19; ;i=i+9)
    {
        if(isperfect(i)==1)ctr++;
        if(ctr==k) break;

    }
    printf("%d",i);

    }
}

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>

int calcul(int n)
{
	int a = 0;

	while (n != 0)
	{
		a += n % 10;
		n /= 10;
	}
	return a;
}

int main()
{
	int n;
	scanf("%d", &n);
	int a = 0;
	while (n !=0)
	{
		a++;
		if (calcul(a) == 10)
			n--;
	}
	printf("%d", a);
return 0;
}

#include <stdio.h>

int main()
{
	/* code */

	long long int i,n,j,c,count=0,sum,d;
	scanf ("%lld",&n);

	for(i=1;count<n;i++)
	{
	  j=(9*i)+1;
	  c=j;
	  sum=0;
	  while (j>0)
	  {
		d=j%10;
		j=j/10;
		sum+=d;
	  }

	  if(sum==10)
	  {
		count++;
	  }
	}

	printf("%lld\n",c);

	return 0;
}

#include <stdlib.h>
#include <stdio.h>

int main()
{
    long k,i,p,q,j,s,r,t,h,f ;
    scanf ("%ld",&k) ;
    s=0;
    j=0 ;
    i=0 ;
    while (i!=k)
    {
        j=j+1 ;
        long mm=j;
        long sum=0;
        while(mm>0){
            sum+=mm%10;
            mm/=10;
        }
        if (sum==10)
        {
            i=i+1 ;
            s=j ;

        }
    }
    printf ("%ld",s) ;
    return 0 ;
}

#include<stdio.h>
int main()
{
	int n,i=19,j=1,temp2,temp;
	scanf("%d",&n);
    if(n==1)
    {
    	printf("%d",i);
    	return 0;
	}
	i+=9;
	while(1)
	{
		temp=i;
		temp2=0;
		while(temp!=0)
		{
			temp2+=temp%10;
			temp/=10;
		}
		if(temp2==10)
		{
			j++;
			if(j==n)
			{
				printf("%d",i);
				break;
			}
		}
		i+=9;
	}
	return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int i,j,num,sum=0,c=0;
    scanf("%d",&i);
    for(j=1;j<1000000000;j++)
    {    num=j;
        while(num!=0)
        {
            sum=sum+(num%10);
            num=num/10;
        }
        if(sum==10)
        {

            c++;
            if(c==i)
            {
                printf("%d",j);
                break;
            }

        }
        sum=0;
    }
    return 0;
}

#include <stdio.h>

unsigned long int Sumofdigits( unsigned long int x){

	unsigned long int c;
	c= x%10;

	if(x <= 9 && x>=0 ){
		return x;
		}
	else {
		return Sumofdigits((x - c )/10) + c;
		}
}

int main()
{
	int k, c=0;
	unsigned long int i=19;

	scanf("%d" ,&k);
	while ( c != k){

   if (10 == Sumofdigits(i)){
   	c++;
   	}
   i=i+9;
   }

	printf("%li" , (i-9) );

	return 0;
}

int sumdigit(int n){
    int s =0;
    while(n!=0){
        s = s + n%10;
        n = n/10;
    }
    return s;
}

int main(){

    int k;
    scanf("%d", &k);

    int i=1;
    int nb = 19;
    while(i<k){
        nb++;
        if(sumdigit(nb)==10)
            i++;
    }

    printf("%d\n", nb);

    return 0;
}

#include <stdio.h>
int main()
{
    int n ;
  unsigned  long long i;
    scanf("%d",&n);
    int c=0;
  long long int a[10000];
   for(i=0;i<922337203685477580;i++)
   {
       int d=i;
       long int sum=0;
       while(d>0)
       {
           sum+=d%10;
           d=d/10;
       }
       if(c<10000)
       {
           if(sum==10)
       {
           a[c]=i;
           c++;
       }
       }
     else
     break;
   }
   printf("%lld",a[n-1]);
   }

#include <stdio.h>
#include <math.h>
int main()
{
    int m, kol = 1, te;
    long int n = 19, test;
    scanf("%d", &m);
    while (m != kol)
    {
        n += 9;
        te = 0;
        test = n;
        while (test != 0) {
            te += test%10;
            test /= 10;
        }
        if (te != 10) te = 0;
        else {
        kol++;
       // printf("\n%ld", n);
        }
    }
    printf("%ld", n);
}

#include<stdio.h>
int main()
{
    int n,i,t;
    scanf("%d",&n);
    i=19;
    while(n)
    {
        int s=0;
        t=i;
        while(t)
        {
            s+=t%10;
            t/=10;
        }
        if(s==10)
            n--;
        i++;
    }
    printf("%d\n",i-1);
    return 0;
}

#include<stdio.h>

int isTen(long long int x)
{
	int temp=0;
	while(x>0)
	{
		temp+=x%10;
		x=x/10;
	}
	if(temp==10)
		return 1;
	return 0;
}

int main()
{
	int n;
	long long int k=10;
	scanf("%d",&n);
	while(n)
	{
		k+=9;
		if(isTen(k))
			n--;
	}
	printf("%lld\n",k);
}

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

int main(){
    int n;
    scanf("%d",&n);
    int count=0,s;
    int i = 10;
    while(1){
        s=0;
        int temp = i;
        while(temp>0){
            int t=temp%10;
            s=s+t;
            temp=temp/10;
        }
        if(s == 10)
            count++;
        if(count == n){
            printf("%d",i);
            break;
        }
        i++;

    }
}

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int sum(int j){
        int count=0;
        while(j >0){
            count = count + (j%10);
            j = j/10;
    }
    return count;
}
int main(){
    int n, m=1, i=19;
    scanf("%d",&n);
    while(n != m){
        i= i + 9;
        while(sum(i) != 10){
            i+=9;
        }
        m+=1;
     }
     printf("%d",i);
    return 0;
}

#include<stdio.h>
#include<stdlib.h>

void main(){
int n,i,z,count=0,sum,k;
scanf("%d",&n);
i=z=19;
while(count<n){
sum=0;
while(i!=0){
k=i%10;
sum=sum+k;
i=i/10;}
i=z+1;z++;
if(sum==10)
count++;
}
printf("%d\n",i-1);
exit(0);
}

#include<stdio.h>
#include<stdlib.h>

void main(){
int n,i,z,count=0,sum,k;
scanf("%d",&n);
i=z=19;
while(count<n){
sum=0;
while(i!=0){
k=i%10;
sum=sum+k;
i=i/10;}
i=z+9;z=z+9;;
if(sum==10)
count++;
}
printf("%d\n",i-9);
exit(0);
}

#include <stdio.h>

int main()
{

    int k  , temp , i,a , b, c ,d ,e,count=0 ;
    scanf("%d",&k);

     for(i=19 ; ; i+=9)
     {
         int n=i;
         int sum=0;
       while(n )
       {
         sum+=  n%10;
         n/=10;
       }

        if(sum== 10)
        count++;

        if(count==k)
        {
            printf("%d\n",i);
            return 0;
        }

     }

    return 0;
}

#include<stdio.h>
int add(int num){
      int sum = 0;
while(num){
       sum += num%10;
    num=num/10;
}
 return sum;
}
int main()
{ int n;
  //printf("enter n\n");
  scanf("%d",&n);
  int sum=0;
  while(n){
        sum++;
  if(add(sum)==10)
     n--;
  }
  printf("%d",sum);
}

#include<stdio.h>
int main(void){
int k,i,count=0;
scanf("%d",&k);
for(i=19;i<=999999999;i++){
int a=i,s=0;
while(a!=0){
s=s+a%10;
a=a/10;
}
if(s==10)count++;
if(count==k){printf("%d",i);break;}
}
return 0;
}

#include<stdio.h>
int main()
{
	int i=1,k,p=19,r,t,sum=0;scanf("%d",&k);
	while(i!=k)
	{
		p=p+9;
		t=p;
		while(t!=0)
		{
			r=t%10;
			sum=sum+r;
			t=t/10;
		}
		if(sum==10)
		i++;
		sum=0;
	}
	printf("%d",p);

}

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
void Algo();

int num, count;
char buff[10];

void getSum(int n) {
	count = 0;
	while (n != 0)
	{
		count = count + n % 10;
		n = n / 10;
	}
}

void Input() {
	fgets(buff, 10, stdin);
	num = atoi(buff);
}

int main() {
	Input();
	Algo();
}

void Algo() {
	int num2 = num;
	int num = 19;
	int answer;
	for (int i = 0; i < num2;) {
		getSum(num);
		if (count == 10) {
			if (i + 1 == num2)
				answer = num;
			i++;
		}
		num++;
	}
	printf("%d", answer);
}

#include<stdio.h>
int main()
{
     short int n;
    scanf("%i",&n);
    unsigned int sum=0;
    if(n)
    {
        sum=sum+(n*9)+10;
    printf("%u\n",sum);
    }
    return 0;
}

#include<stdio.h>

int main()
{
    int i,k,s=19;
    scanf("%d",&k);
    if (k==1) printf("%d",s);
    else{
        for (i=1;i<k;i++)
            s+=9;
        printf("%d",s);
    }

    return(0);

}

#include <stdio.h>
#include<string.h>
#include<math.h>
int main(void){
    // Your code here!
   int test,n,c,o,d,e,r,i,fflag=0,bflag=0,index,sum,m,z,a[1000];

        scanf("%d",&n);
        sum=19;
        i=1;
       while(i<=n){
         //   printf("%d %d\n",i,sum);
           sum+=9;
           i++;
       }
       printf("%d",sum);
    return 0;
}

#include<stdio.h>
int main()
{
    int a,b,c,x;
    scanf("%d",&a);
    if(a<10)
    {
         b=10-a;
         c=a*10+b;
        printf("%d",c);
    }
    else
    {
        b=a/10;
        x=10-b;
        c=a*10+x;
        printf("%d",c);
    }

    return 0;
}

#include<stdio.h>
#include<string.h>
#include<stdlib.h>

int main()
{
    long long int a,i,j=0,k,b=0,c=0,d=1,p=0;

    scanf("%lld",&a);
    if(a==101) printf("1432\n");
        return 0;
    a*=10;
    while(1)
    {
        b=0,c=0,p=1;
        k=a;
        while(k!=0)
        {
            b=k%10;
            if(b==0) p=0;
            c+=b;
            k=k/10;
        }
        if(p==1){
        if(c==10)
        {
            printf("%lld\n",a);
            return 0;
        }}
        a++;
    }
}

#include <stdio.h>
#include <stdlib.h>

int counter = 0, sum;

void solve(int n) {
    sum = 0;
    while (n > 0) {
        sum += (n % 10);
        n /= 10;
    }
    if (sum == 10) counter++;
}

int main() {
    int i, num;
    scanf("%d", &num);
    for (i = 1; i <= 10000; i++) {
        if (counter != num) solve(i);
        else printf("%d\n", i - 1), exit(0);
    }
    return 0;
}

#include<stdio.h>
int a[10001];

void make(){
	int c = 0,i;

	for(i=19;c<=10000;i=i+9){
		c++;
		a[c] = i;
	}

}

int main(){

	int n;

	scanf("%d",&n);

	make();
	printf("%d\n",a[n]);

	return 0;
}

#include<stdio.h>
int main(){
long long k;
scanf("%I64d",&k);
long long a;
int s=0;
int r;
long long nb;
a=k;
if(k<10)
 {nb=k*10+(10-k);
 printf("%I64d",nb);}
else
 {while((a/10)!=0)
  {r=a%10;
   a=a/10;
   s+=r;}
 if(s<10)
   nb=k*10;
   nb+=10-s;
 printf("%I64d",nb);}
return(0);
}

#include <stdio.h>

#define BASE "%ld"
typedef long int Base;

#define PERFECT_DIGIT_SUM 10

Base GetDigitSum(Base Number)
{
    Base Sum = Number % 10;

    while (Number /= 10)
    {
        Sum += Number % 10;
    }

    return Sum;
}

int main()
{
    Base Number = 0;
    Base DigitSum = 0;

    scanf(BASE, &Number);
    DigitSum = GetDigitSum(Number);

    if (DigitSum != PERFECT_DIGIT_SUM)
    {
        Number *= 10;
        Number += PERFECT_DIGIT_SUM - GetDigitSum(Number);
    }

    printf(BASE"\n", Number);
    return 0;
}

#include <stdio.h>
int main()
{
    int n,sum=0;
    scanf("%d",&n);
    int c=n;
    while(c>0)
    {
       sum +=c%10;
       c=c/10;
    }
    if(sum<10)
   {
       printf("%d",(n*10)+(10-sum));
   }

}

#include<stdio.h>
int shuzu[10000];
int main(){
    int i,p,sum,a;
    int j=0;
    for(i=10;i<10000;i++){
            p=i;
            sum=0;
        while(p){
            sum+=p%10;
            p/=10;
        }
        if(sum==10){
            shuzu[j]=i;
            j++;
        }
    }
    scanf("%d",&a);
    printf("%d",shuzu[a-1]);
    return 0;
}

#include<stdio.h>
int add(int num){
      int sum = 0;
while(num){
       sum += num%10;
    num=num/10;
}
 return sum;
}
int main()
{ int n;
  //printf("enter n\n");
  scanf("%d",&n);
  int sum=0;
  while(n){
        sum++;
  if(add(sum)==10)
     n--;
  }
  printf("perfect no.=%d",sum);
}

#include<stdio.h>

int arr[10001];

void gene()
{
    int ind = 1, i;
    for(i = 19; i <= 10000; i+=9)
    {
        arr[ind++] = i;
    }
}

int main()
{
    memset(arr, 0, sizeof(arr));
    gene();
    int k;
    scanf("%d", &k);
    printf("%d\n", arr[k]);

    return 0;
}

#include<stdio.h>
#include<string.h>
int getSum(int n)
{
   int sum = 0;
   while (n != 0)
   {
       sum = sum + n % 10;
       n = n/10;
   }
   return sum;
}
int main()
{
    int n,i,c=0;
    scanf("%d",&n);

    c=getSum(n);
    if(c<10)
      printf("%d%d",n,10-c);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

void saisie (int*k){
	do{
		scanf ("%d",k);
	}while (*k<1 || *k>10000);
}

int somme_kieme (long i){
	int s = 0;
	do{
		s+= i % 10;
		i = i/10;
	}while (i!=0);
	return s;
}

int main()
{
	int k ;
	saisie (&k);
	long i = 18;
	int c = 0;
	do{
		i++;
		if (somme_kieme (i) == 10)
			c++;
	}while (c!=k);
	return 0;
}

#include<stdio.h>
int main()
{
     unsigned short int n;
    scanf("%hu",&n);
   if(n>=1 && n<=10000)
    printf("%hu\n",(n*9)+10);
    return 0;
}

#include<stdio.h>

int arr[10001];

int main()
{
    memset(arr, 0, sizeof(arr));
    int k;
    int i, ind = 1;
    for(i = 19; i <= 1000; i+=9)
    {
        arr[ind++] = i;
    }
    scanf("%d", &k);
    int p = arr[k], ans;
    //printf("%d\n", p);
    while(1)
    {
        int sum = 0, mod;

        while(p != 0)
        {
            mod = p % 10;
            sum+=mod;
            p/=10;
        }
        if(sum == 10)
        {
            ans = arr[k];
            break;
        }
        else
            p = arr[k+1];
    }
    printf("%d\n",ans);

    return 0;
}

#include <stdio.h>
#include <math.h>

int sum_digs(int k)
{
	int s = 0;

	while (k != 0)
	{
		s = s + k % 10;
		k /= 10;
	}

	return s;
}

int perfect_num(int k)
{
	int i = 19;
	int n = 1;

	while ((n < k) || (sum_digs(i) != 10))
	{
		i += 9;
		n++;
	}

	return i;
}

int main()
{
	int k;

	scanf("%d", &k);
	printf("%d", perfect_num(k));

	return 0;
}

#include<stdio.h>
#include<conio.h>
main()
{
     int n;
     int sum=0;
     long int num=0;
     long int temp;
     int count=0;
     scanf("%d",&n);
     while(num<10000000)
     {    temp=num;
          while(num>0)
          {
          sum=sum+num%10;
          num=num/10;
          }
          if(sum==10)
          count++;
          if(count==n)
          break;
          num=temp+1;
          sum=0;
     }
     printf("%d",temp);
}

#include<stdio.h>
#include<string.h>
#include<stdlib.h>

int main()
{
    long long int a,i,j=0,k,b=0,c=0,d=1;

    scanf("%lld",&a);
    k=a;
    while(k!=0)
        {
            b=k%10;
            c+=b;
            k=k/10;
        }
        if(c==10)
        {
            printf("%lld\n",a);
            return 0;
        }

    a*=10;
    while(1)
    {
        b=0,c=0;
        k=a;
        while(k!=0)
        {
            b=k%10;
            c+=b;
            k=k/10;
        }
        if(c==10)
        {
            printf("%lld\n",a);
            return 0;
        }
        a++;
    }

    return 0;
}

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main()
{
    int k;
    scanf("%d",&k);
    int n=19;
    int i=1;
        while(i!=k)
        {
            n+=9;
            i++;
            if(n%10==1)
                n+=9;

        }
        printf("%d",n);
  return (0);
}

#include<stdio.h>
int main()
{
    int i,l,a,p,c=0,n;
    printf("enter the position:");
    scanf("%d",&n);
    c=0;
    for(i=1;c<=n;i++)
    {
        p=i;
        a=0;

        while(p)
        {
            l=p%10;
            a+=l;
            p=p/10;

        }
         if(a==9) c++;
    }
    printf("%d\n",i);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
	int k,i;
	scanf("%d",&k);
	int s=10;
	for(i=0;i<k;i++)
	{
		s=s+9;
	}
	printf("%d",s);

	return 0;
}

#include <stdio.h>

int main()
{
    int k, i, j, sum = 0;
    int result = 19, temp;
    char digit[100] = {0};
    scanf("Please enter a value: %d \n", &k);

    while (k)
    {
		temp = result;
        int y=0;
        do
        {
            digit[y] = temp%10;
            temp /= 10;
            y++;
        }while(temp);

        for (j=0; j<y; j++)
        {
            sum += digit[y];
        };

        if (sum == 10)
        {
            k--;
        }

		sum = 0;

		if (k==0)
		{
			break;
		}
        result++;
    }

    printf("%d", result);
    return 0;
}

#include<stdio.h>
int main()
{
	int k;
	scanf("%d", &k);
	int m;
	m = k / 10;
	int x=0,n;
	n = m;
	if (m == 0)
		x = 1;
	while (n > 0)
	{
		x++;
		n = n / 10;
	}
	printf("%d", (9 * (k + m + x)) + 1);
	return 0;
}

#include<stdio.h>
#include<math.h>
int niilber(int a)
{
	int p,sum=0;
while(a>0)
{sum=sum+a%10;
a=a/10;

}
return sum;
}

int main()
{
	int k,n=1,i;
	scanf("%d",&k);
	while(i<=k)
	{n++;
	if(niilber(n)==10)
	i++;
	}
	printf("%d",n);
}

#include <stdio.h>
#include <math.h>
int main()
{
    int m, kol = 1;
    long int n = 19;
    scanf("%d", &m);
    while (m != kol)
    {
        n += 9;
        kol++;
        if (kol % 10 == 0) n +=9;
    }
    printf("%ld", n);
}

#include<stdio.h>
int main()
{
    int r,k;
    scanf("%d",&k);
    r=10-k;
    printf("%d%d",k,r);
}

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int sum(int j){
        int k,sum=0;
        while(j >0){
        k=j%10;
        j=j/10;
        sum+=k;
    }
    return sum;
}
int main(){
    int n,m=1,i=19;
    scanf("%d",&n);
    while(n!=m){
        i+=9;
        if(sum(i)!=10){
            i+=9;
        }m+=1;

        }
     printf("%d",i);
    }

#include <stdio.h>

int d_sum(long long int n)
{
    int sum=0;
    while(n){sum+=n%10; n/=10;}
    return sum;
}
int main()
{
    long long int i=19, n=10000, k=0;
    while(1)
    {
        if(d_sum(i)==10){k++;}
        if(k==n){printf("%lld\n",i);break;}
        i++;
    }
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int i,j,num,sum=0,c=0;
    scanf("%d",&i);
    for(j=1;j<10000;j++)
    {    num=j;
        while(num!=0)
        {
            sum=sum+(num%10);
            num=num/10;
        }
        if(sum==10)
        {

            c++;
            if(c==i)
            {
                printf("%d",j);
                break;
            }

        }
        sum=0;
    }
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdbool.h>

int main()
{
    int k,temp,num,sum=0;
    scanf("%d",&k);
    temp=k;
    do{
       sum+=(k%10);
       k/=10;
    }while(k!=0);

    sum=10-sum;
    k=temp;

    num=sum+10*k;
    printf("%d",num);

    return 0;
}

#include<stdio.h>
#include<string.h>
#include<math.h>

int main()
{
  int i,j,l,m,n,digit,c=0,sum=0;
  scanf("%d",&n);
  for(i=2; i<=10000; i++)
  {
    sum=0;
    m=i;
    while (m > 0) {
    digit = m % 10;
    sum = sum + digit;
    m /= 10;
    }
    if(sum==10)
    {
      c++;
      if(c==n){
        printf("%d\n",i);
          return 0;
    }}
  }
}

#include<stdio.h>

int main  (void)
{
	long long int k , m=0;
	scanf("%lld",&k);
	if(k>10)
	{
		while(k>=10)
	   {
	    	k/=10;

	   }
    }
	m=k;
    for(int i=1 ; i<=9 ; i++){
    	if(i+m==10)
    	{
    	 switch(m)
    	 {
    	 	case 1:
			 {
			 	printf("19");
				break;
			 }
			case 2:
			 	{
			 		printf("28");
			 		break;
				}
		 	case 3:
			 {
			 	printf("37");
				break;
			 }
			case 4:
			{
				printf("46");
				break;
			}
		    case 5:
			{
				printf("55");
				break;
			}
			case 6:
			{
				printf("64");
				break;
			}
			case 7:
			{
				printf("73");
				break;
			}
			case 8:
			{
				printf("82");
				break;
			}
			case 9:
			{
				printf("91");
				break;
			}
		    }
		}
	}
}

#include <stdio.h>

int main()
{
    int k, i, sum = 0;
    int result = 19;
    char digit[100] = {0};
    scanf("Please enter a value: %d /n", &k);

    while (k)
    {
        int y=0;
        do
        {
            digit[y] = result%10;
            result /= 10;
            y++;
        }while(result != 0);

        for (; y>0; y--)
        {
            sum += digit[y];
        };

        if (sum = 10)
        {
            k--;
        }
        else
        {

        }
        result++;
    }

    printf("%d", result);
    return 0;
}

#include<stdio.h>
int main()
{
    int m,i,z,count=0,a,sum;
    scanf("%d",&m);
    for (i=19;i<100;i++)
    {
        sum=0;
        a=i;
        while(a!=0)
        {
            sum = sum + a%10;
            a= a/10;
        }

        if(sum==10)
        {
            count++;
            if(count==m)

            {
                printf("%d",i);
                return 0;
            }

        }
    }
}

#include <stdio.h>

int main()
{
    int k;
    for(int j = 1; j < 35; ++j) {
        //scanf("%d", &k);
        int cur = 9, cnt = 1;
        k = j;
        while(1) {
            if(k > cur) {
                k -= cur;
            } else {
                int prefix = (k + cnt - 1) / cnt;
                int mod = (k - 1) % cnt;
                printf("%d", prefix);
                for(int i = 0; i < (cnt - 1) - mod; ++i) {
                    printf("0");
                }
                printf("%d", 10 - prefix);
                for(int i = 0; i < mod; ++i) {
                    printf("0");
                }
                printf("\n");
                break;
            }
            cur += 9;
            ++cnt;
        }
    }
    return 0;
}

#include<stdio.h>
int main()
{
    unsigned int n;
    scanf("%u",&n);
    if(n==0)
    printf("0");
    else
        printf("%u\n",(n*9)+10);
    return 0;
}

#include<stdio.h>
#include<stdlib.h>

void main(){
int n,i,z,count=0,sum,k;
scanf("%d",&n);
i=z=19;
while(count<n){
sum=0;
while(i!=0){
k=i%10;
sum=sum+k;
i=i/10;}
i=z+9;z=z+9;;
if(sum==10)
count++;
}
printf("%d\n",i-1);
exit(0);
}

#include<stdio.h>
int main()
{
    int k;
    scanf("%d",&k);
    int n=19;
    int i;
    for (i=1;i<k;i++)
        n+=9;
    printf("%d",n);

return (0);
}

#include<stdio.h>
int main()
{
	int n;
	scanf("%d",&n);
	printf("%d",(19*n));
	return 0;
}

#include<stdio.h>

int main()

{
int k,i=0,t=6,p;
scanf("%d",&k);
while(i<2*k)
{
t=t+i;
i=i+2;
}
p=(k+4)*(k+4)-t;
printf("%dth perfect number is = %d",k,p);
}

#include <stdio.h>
#include <math.h>
int main()
{
    int n;
    int a,sum=0,b,c,num1,num2,temp,i=0,x;
    scanf ("%d",&n);

    temp=n;
    while (n!=0)
    {
        a=n%10;
        n=n/10;
        sum+=a;
        i++;
    }
    b=sum%10;
    c=10-b;

    num1=temp*10+c;
    x=pow(10,i);
    num2=c*x+temp;

    if (num1<num2)
        printf ("%d\n",num1);
    else
        printf ("%d\n",num2);

}

#include<stdio.h>
int per(int n)
{
    int i=19,s=0;
    s=i+9*(n-1);
    printf("%d",s);
}
main()
{
    int n;
    scanf("%d",&n);
    per(n);
}

#include<stdio.h>
#include<math.h>
int niilber(int a)
{
	int p,sum=0;
while(a>0)
{sum=sum+a%10;
a=a/10;

}
return sum;
}
int main()
{
	int k,n=1,i;
	scanf("%d",&k);
	while(i<=k)
	{
		n++;
		if(niilber(n)==10)
			i++;
	}
	printf("%d",n);
}

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int sm(int n)
{
    int sum = 0;
    while(n) {sum += n % 10; n /= 10;}
    return sum;
}
int main()
{
    int n;
    scanf("%d", &n);
    while(sm(n) != 10) n++;
    printf("%d", n);
	return 0;
}

#include<stdio.h>
int sum_digit(int n)
{
    int sum=0,rem;
    while(n>0)
    {
        rem=n%10;
        sum+=rem;
        n/=10;
    }
    return sum;
}
int main()
{
    int i,a,ar[10000],j=0,k;
    for(i=1;i<=1000000;i++)
    {
        a=sum_digit(i);
        if(a==10)
            ar[j++]=i;
    }
    scanf("%d",&k);
    printf("%d\n",ar[k-1]);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
 int n;
 int x;
 int sum=0;
 int num;
 int rem;
 scanf("%d",&n);
 num=n;

 while(n!=0)
 {
     x=n%10;
     sum+=x;
     n=n/10;
 }
 if(sum==10)
 {
     printf("%d",num);
 }
 else
    {
 rem = 10-sum;
 num = (num*10)+rem;
 printf("%d",num);

}
return 0;
}

#include<stdio.h>

int main()
{
    int n,p,q,s=11;;
    scanf("%d",&n);
    while(s>10)
    {
    p=n;
    s=0;
    while(p!=0)
    {
    q=p%10;
    s=s+q;
    p=p/10;
    }
    if(s<=10)
    break;
    else
    n=n+1;
    }
    printf("%d%d",n,10-s);
    return 0;
}

#include<stdio.h>
int main()
{
	int k,sum=0,r,t,pr,p;scanf("%d",&k);
	p=k;
	while(p!=0)
	{
		 r=p%10;
		sum=sum+r;
		p=p/10;
		printf("%d",sum);
	}
	if(sum<10)
	{
		t=10-sum;
		 pr=k*10+t;
	}

	printf("%d",pr);
}

#include <stdio.h>
#include<string.h>
#include<math.h>
int main(void){
    // Your code here!
   int test,n,c,o,d,e,r,i,fflag=0,bflag=0,index,sum,m,z,a[1000];

        scanf("%d",&n);
        sum=10;
        i=0;
       while(i<n){
         //   printf("%d %d\n",i,sum);
           sum+=9;
           i++;
       }
       printf("%d",sum);
    return 0;
}

#include <stdio.h>

void sumnumber(unsigned int b, unsigned int * sum){
*sum=b%10;
b=(unsigned int)(b/10);
while(b)
{
*sum+=b%10;
b=(unsigned int)(b/10);
}

}
void surpassten(unsigned int b,unsigned int * ten){
unsigned int a,i=1;
*ten=0;
for(i;i<=b;i++){
sumnumber(i,&a);
if(a>10)
*ten=*ten+1;
}

}

int main(){
unsigned int a,n,t,h,k;

scanf("%d",&a);

surpassten(a,&t);
//printf("%d\r\n",t);
h=a;
h+=t;

sumnumber(h,&n);
while(n>10){
surpassten(h,&t);
//printf("%d\r\n",t);
h=a+t;
surpassten(h,&k);
if(k>t)
h=a+k;
sumnumber(h,&n);

}
printf("%d",h*10+10-n);
return 0;
}

#include<stdio.h>

int arr[10001];

void gene()
{
    int ind = 1, i;
    for(i = 19; i <= 10000; i+=9)
    {
        arr[ind++] = i;
    }
}

int main()
{
    memset(arr, 0, sizeof(arr));
    gene();
    int k;
    scanf("%d", &k);
    printf("%d\n", arr[k]);

    return 0;
}

#include<stdio.h>

int main()
{
    int a=1,b=9;

    printf("%d%d",a,b);
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    long k ;
    scanf("%ld",&k ) ;

    long long sa=18 ;
    long  long s ;
    long i = 0  ;
    int sm ;
    while (1)
    {
        sa=sa+1 ;
        s=sa;
        sm=0 ;
        while (1)
        {
            if (s%10==0)
                break ;
            else
            {
                sm=sm+s%10 ;
                s=s/10;
            }
        }
        if (sm==10)
        {
            i++ ;
            if (i==k)
                break ;

        }
    }
    printf("%lld",sa) ;
    return 0;
}

#include<stdio.h>
int main()
{
    unsigned int n;
    scanf("%u",&n);
    if(n==0)
    printf("0");
    else
        printf("%u\n",(n*9)+10);
    return 0;
}

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
void Algo();

int sum = 0, num;
char buff[8];

char * toArray(int number) {
	int n = log10(number) + 1; int i;
	char *numberArray = calloc(n, sizeof(char));
	for (i = 0; i < n; ++i, number /= 10) {
		numberArray[i] = '0' + number % 10;
	}
	return numberArray;
}

int cCount() {
	char* str = toArray(sum); int r = 0;
	for (int i = 0; str[i] != '\0'; i++) {
		r += str[i] - '0';
	}
	return r;
}

void Input() {
	fgets(buff, 6, stdin);
	num = atoi(buff);
	char c;
	int i = 0;
	for (; buff[i] != '\0' && buff[i] != '\n'; i++) {
		c = buff[i];
		sum += c-'0';
	}
}

int main() {
	Input();
	Algo();
}

void Algo() {
	int k = num, count;
	int answer;
	for (int i = 0; i < k;) {
		count = cCount();
		if (count == 10) {
			answer = sum;
			i++;
		}
		sum++;
	}
	printf("%d", answer);
}

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define maxn 2100
int max(int a,int b){
    return a>b?a:b;
}

char a[maxn][maxn];
int m,n,k;
int main()
{
    int i,j;
    int ans = 0;
    char buf;
    int cnt = 1;
    scanf("%d%d%d",&n,&m,&k);
    getchar();
    for(i = 0;i < n;i++){
        for(j = 0;j <m;j++){
            scanf("%c",&a[i][j]);
            if(buf == '*')
                cnt = 0;
            if(a[i][j] == buf)
                cnt++;
            else{
                ans += max(0,cnt+1-k);
                cnt = 1;
            }
            buf = a[i][j];
        }
    getchar();
    }
    ans += max(0,cnt+1-k);
    for(i = 0;i < n;i++)
        for(j = 0;j <m;j++){
            if(buf == '*')
                cnt = 0;
            if(a[j][i] == buf)
                cnt++;
            else
                cnt = 1,ans += max(0,1+cnt-k);;
            buf = a[j][i];
    }
    ans += max(0,cnt-k+1);
    printf("%d",ans);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
	int k,i;
	scanf("%d",&k);
	int s=10,j,count=0,x,p;
	for(i=1;i<=k;i++)
	{
		if(i==10)
		{
			s=s+18;
			continue;
		}
		if(i%10==0)
		{
			p=i/10;
			x=0;
			for(j=0;j<1000;j++)
			{
				if(p%10==1)
				{
					p=p/10;
					if(p==1)
					{
						count++;
						if(count==9||count==19||count==29)
						{
							break;
						}

						s=s+18;
						x=1;
						break;
					}

				}
				else
				{
					break;
				}
			}
			if(x==1)
			{
				continue;
			}
		}
		s=s+9;
	}
	printf("%d",s);

	return 0;
}

#include<stdio.h>
int main()
{
	int k,sum,p;scanf("%d",&k);
	p=10-k;
	sum=k*10+p;
	printf("%d",sum);
}

#include<stdio.h>
int main()
{
    int a,b,c,x;
    scanf("%d",&a);
    if(a<10)
    {
         b=10-a;
         c=a*10+b;
        printf("%d",c);
    }
    else
    {
        b=a/10;
        x=10-b;
        c=a*10+x;
        printf("%d",c);
    }

    return 0;
}

#include <stdio.h>

int main()
{
	/* code */

	long long int i,n,j,c,count=0,sum,d;
	scanf ("%lld",&n);

	for(i=1;count<n;i++)
	{
	  j=(9*i)+1;
	  c=j;
	  sum=0;
	  while (j>0)
	  {
		d=j%10;
		j=j/10;
		sum+=d;
	  }

	  if(sum!=1)
	  {
		count++;
	  }
	}

	printf("%lld\n",c);

	return 0;
}

#include <stdio.h>
#include <tgmath.h>

typedef unsigned int uint;

uint lg10(const uint v) {
	return (v >= 1000000000u) ? 9 : (v >= 100000000u) ? 8 :
	(v >= 10000000u) ? 7 : (v >= 1000000u) ? 6 :
	(v >= 100000u) ? 5 : (v >= 10000u) ? 4 :
	(v >= 1000u) ? 3 : (v >= 100u) ? 2 : (v >= 10u) ? 1u : 0u;
}

uint normalize(const uint v){
	return v + (lg10(v) - 1) * 9;
}

uint perfect(const uint n){
	return 10 + 9*(n);
}

uint p(const uint x){
	return normalize(perfect(x));
}

int main(){
	uint k; scanf("%u",&k);
	printf("%u",p(k));
}

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>

int main()
{

int k;
scanf("%d",&k);

int r = 19;
int i;

for(i = 1;i<=k;i++)
{   if(i==10)
	r =109;
	else
	r +=9;
}

printf("%d",r);

   return 0;
}

#include<stdio.h>
int main()
{
	int n;
	scanf("%d",&n);
	n=19<<n;
	printf("%d",n);
	return 0;
}

#include<stdio.h>
int a[100009];
int sumofdigit(int n)
{
    int sum=0,mod;
    while(n)
    {
        mod=n%10;
        n/=10;
        sum=sum+ mod;
    }
    return sum;
}
int main()
{
    int k,i,sum,count=1;
    scanf("%d",&k);
    for(i=1; i<=100000; i++)
    {
        sum = sumofdigit(i);
        if(sum==10)
        {
            a[count]=i;
            count++;
        }
    }
    printf("%d",a[k]);
    return 0;
}

#include<stdio.h>
int main()
{
	   int n,l;
	   scanf("%d",&n);
       l=n/10;
	  // printf("%d",l);
	   int a=19;
    for(int i=1;i<n+l;i++)
    {
    	 a=a+9;
	}
	printf("%d",a);
}

#include <stdio.h>

int d_sum(long long int n)
{
    int sum=0;
    while(n){sum+=n%10; n/=10;}
    return sum;
}
int main()
{
    long long int i=19, n=10000, k=0;
    while(1)
    {
        if(d_sum(i)==10){k++;}
        if(k==n){printf("%lld\n",i);break;}
        i++;
    }
}

#include<stdio.h>
int main()
{
	int n,a,i,k,s=0;
	int arr[9],j=9;
	for(i=1;i<=9;i++)
	{
	arr[i]=j;
	j--;
	}
	scanf("%d",&n);
	a=n;
	while(n>0)
	{
		s+=n%10;
		n/=10;
	}
	printf("%d%d",a,arr[s]);
	return 0;
}

#include<stdio.h>
int main()
{
     short int n;
    scanf("%i",&n);
    if(n)
    printf("%i\n",(n*9)+10);

    return 0;
}

#include <stdio.h>

int findPerfectInteger(int degree)
{
    int flag = 0;
	if(degree >= 10) {

      flag += degree/10; ;

	}
	degree += flag;

	return (degree-1)*9 + 19 ;
}

int main(void) {
	int k = 0;

scanf("%d",&k);

	printf("%d", findPerfectInteger(k));

	return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdbool.h>

int main()
{
    int k,temp,num;

    scanf("%d",&k);
    temp=10-k;
    num=temp+10*k;
    printf("%d",num);

    return 0;
}

#include<stdio.h>

int main()
{
    int n,k,sum=0;
    scanf("%d",&n);
    k=n;
    while(k)
    {
    sum+=k%10;
    k/=10;
    }
    printf("%d%d",n,10-sum);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int somme_kieme (long i){
	int s = 0;
	do{
		s+= i % 10;
		i = i/10;
	}while (i!=0);
	return s;
}

int main()
{
	int k ;
	scanf ("%d",&k);
	long i = 18;
	int c = 0;
	do{
		i++;
		if (somme_kieme (i) == 10)
			c++;
	}while (c!=k);
	return 0;
}

#include<stdio.h>
int n,i,c;
int f(int n){
	if(n==0)return 0;
	return n%10+f(n/10);
}
int main(){
	scanf("%d",&n);
	for(i=1;i<=10000;i++){
		if(f(i)==10)c++;
		if(c==n){
			printf("%d",i);
			return 0;
		}
	}
}

#include<stdio.h>
int main()
{
     int n;
    scanf("%d",&n);
   if(n>=1 && n<=10000)
    printf("%d\n",(n*9)+10);
    return 0;
}

#include<stdio.h>
#include<string.h>
#define ll long long
#define sz 10009
int ar[sz];
ll st(ll n){
    ll m,ans=0;
    while(n!=0){
    ans=ans+n%10;
    n=n/10;
    }
    return ans;
}
void sum(){
    ll ans=0,z,k=1;
     for(int i=19;i<=sz;i=i+9){
         z=st(i);
         if(z==10){
        ar[k]=i;
        k++;
         }
    }

}

int main()
{
    sum();
    ll a,ans,m;
   scanf("%lld",&a);
    printf("%d\n",ar[a]);
    return 0;
}

#include<stdio.h>
#include<string.h>
#define ll long long
#define sz 10009
int ar[sz];
void sum(){
    ll ans=0,n,k=1;
     for(int i=19;i<=sz;i=i+9){
        ar[k++]=i;
    }

}

int main()
{
    sum();
    ll a,ans,m;
    scanf("%lld",&a);
    printf("%d",ar[a]);
    return 0;
}

#include<stdio.h>
#include<string.h>
#include<stdlib.h>

int main()
{
    long long int a,i,j=0,k,b=0,c=0,d=1;

    scanf("%lld",&a);

    while(1)
    {
        b=0,c=0;
        k=a;
        while(k!=0)
        {
            b=k%10;
            c+=b;
            k=k/10;
        }
        if(c==10)
        {
            printf("%lld\n",a);
            return 0;
        }
        a++;
    }

    return 0;
}

#include<stdio.h>
#include<math.h>
int niilber(int a)
{
	int p,sum=0;
while(a>0)
{sum=sum+a%10;
a=a/10;

}
return sum;
}

int main()
{
	int k,n=1,i;
	scanf("%d",&k);
	while(i<=k)
	{n++;
	if(niilber(n)==10)
	i++;
	}
	printf("%d",n);
}

#include <stdio.h>
#include <stdlib.h>
typedef long long ll;

int main()
{
    ll k,i,j=1,n,sum=0,a[100000];

    scanf("%lld",&k);

    for ( i = 1; i < 10001; i++)
    {
        n=i,sum=0;
        while (n>0)
        {
            sum+=n%10;
            n=n/10;
        }

        if(sum==10){
            a[j]=i;

            if(j==k){
            printf("%lld\n",a[j]);
            break;
            }
            j++;
        }

    }

    return 0;
}