package main import ( "fmt" "bufio" "os" "strconv" ) func check3 (a int) bool{ if a%3==0 { return true } for ;a > 0; a/= 10{ if a%10==3{ return true } } return false; } func main() { var a, b = nextInt(), nextInt() for i := a; i <= b; i++ { if check3(i) { fmt.Println(i) } } } var s = bufio.NewScanner(os.Stdin) func next() string { s.Split(bufio.ScanWords) s.Scan() return s.Text() } func nextLine() string { s.Split(bufio.ScanLines) s.Scan() return s.Text() } func nextInt() int { i, e := strconv.Atoi(next()) if e != nil { panic(e) } return i } func nextLong() int64 { i, e := strconv.ParseInt(next(), 10, 64) if e != nil { panic(e) } return i }