#include <iostream>
#include <fstream>
using namespace std;

int main()
{
	ifstream fin("input.txt");
	ofstream fout("output.txt");

	int s;
	fin>>s;
	if (s%9) fout<<s%9;
	for (int i=0; i<s/9; i++)
		fout<<9;
	
	fin.close();
	fout.close();
	return 0;
}

