package main import ( "fmt" "regexp" "strconv" ) func main() { var A, B string reg := regexp.MustCompile(`^((0)|([1-9][0-9]{1,4}))$`) fmt.Scan(&A, &B) a, _ := strconv.Atoi(A) b, _ := strconv.Atoi(B) if reg.MatchString(A) && reg.MatchString(B) && a <= 12345 && b <= 12345 { fmt.Println("OK") } else { fmt.Println("NG") } }