#include using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(0); ll n; cin >> n; ll md = 9'999'999'999ll % n; string ans(10, '9'); if(md == 0){ cout << ans << '\n'; return 0; } for(int i = 11; i < 2000; i++){ ans += '9'; md *= 10; md += 9; md %= n; if(md == 0){ cout << ans << '\n'; return 0; } } }