#include using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (ll)(n); i++) #define oke cout << "Yes" << '\n'; #define dame cout << "No" << '\n'; #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() using HaiI = vector>; using Hai2 = vector>; using HaiB = vector>; using Hai3 = vector>>; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout << fixed << setprecision(15); ll N; cin>>N; for(ll i=0;i<1e100;i++){ string S; if(i!=0){ S=to_string(i); }else{ S=""; } string T=S; reverse(all(T)); rep(j,10){ string K=S+to_string(j)+T+"9"; if(i==0 && j==0){ continue; } ll A=stoll(K); if(A>=1e9 && A%N==0){ cout<