import scala.io.StdIn.readLine

object Main {
  val a = Array.ofDim[Int](10,101)

  def sum(n:Int, s:Int, x:Int):Int = {
    if(n==1) { if(s >= 0 && s<=9 && s > x ) 1 else 0 }
    else {
      if(a(n)(s) > 0) a(n)(s)
      else {
        val y = { for(i <- 0 to 9 if s>=i && i>x) yield sum(n-1,s-i,if(i>x) i else x) }.sum
        a(n)(s) = y;y
      }
    }
  }

  def getSum(sb:StringBuilder):Unit = {
    val r = readLine.split(" ").map(_.toInt)

    if(r(0)==0 && r(1)==0) print(sb.result)
    else {
      if(r(0)*9<r(1)|| (r(0)-1)*r(0)/2>r(1)) println(0)
      else println(sum(r(0),r(1),-1))
      getSum(sb)
    }
  }

  def main(args:Array[String]) = getSum(new StringBuilder)
}