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