#include using namespace std; int main(){ int A,B; cin >> A >> B; for(int i=A;i0;j/=10){ if(j%10==3){ cout << i << endl; break; } } } return 0; }