#include <iostream> using namespace std; int main(){ int n; cin>>n; for(int i =10;i<=n;i++){ int t = i,sum = 0; while(t != 0){ sum = sum + t%10; t = t/10; } if(i%sum==0) cout<<i<<endl; } return 0; }