//gcc //#include //clang #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; using vi = vector; using vl = vector; using vvi = vector; using vvl = vector; using pii = pair; using pll = pair; using pil = pair; using pli = pair; const char alphabetl[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}; const char alphabetu[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'}; static const double EPS = 1e-14; static const ll INFLL = 1e18; static const int INF = (1 << 30) - 1; static const ll MOD = (ll) 1e9 + 7; const int NM = 101001;//max index of array int dp[NM]; #define cauto const auto& #define bit(n) (1LL<<(n)) #define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() ); #define itn int #define ZERO(a) memset(a, 0, sizeof(a)) #define MINUS(a) memset(a, 0xff, sizeof(a)) #define INF(a) memset(a, 0x3f, sizeof(a)) #define FILL(a,c) fill(a, a+ sizeof(a)/sizeof(*a),c) #define FILL2D(A,c) fill(A[0], A[0] +sizeof(A)/sizeof(**A),c) #define FILL3D(A,c) fill(A[0][0], A[0][0] +sizeof(A)/sizeof(***A),c) #define SZ(x) ((int)(x).size()) #define rep(i,n) for(int i=0; i<(int)(n); i++) #define rrep(i,n) for(int i=n; i>0; i--) #define FOR(i,a,b) for(int i=a; i<(int)(b); i++) #define FOREQ(i,a,b) for(int i=a; i<=(int)(b); i++) #define RFOR(i,a,b) for(int i=a; i>(int)(b); i--) #define REP(i,n) for(int i=0, i##_len=(n); i bool chmin(T1 &a, T2 b) { return b < a && (a = b, true); } template bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); } const ll MAX_V = 1010; const ll MAX_E = 2010; ll V, E; struct edge { ll from, to, cost; }; edge ES[MAX_E]; ll d[MAX_V]; class range {private: struct I{int x;int operator*(){return x;}bool operator!=(I& lhs){return x> A >> B; C = B - A + 1LL; FOREQ(i,A,B){ bool isThree = false; if (i % 3 == 0) isThree = true; else { string s = to_string(i); for(int j = 0; j < s.size(); j++) { if (s[j] == '3'){ isThree = true; break; } } } if(isThree) PRINT(i) } }