
object Main extends App {

  import scala.io.StdIn._
  println(if (isValid(readLine.trim.toList)) "VALID" else "INVALID")
  def isLengthOver6(str: List[Char]): Boolean = str.size >= 6
  def isIncludeNumber(str: List[Char]): Boolean = str.exists(_.isDigit)
  def isIncludeUppercase(str: List[Char]): Boolean = str.exists(_.isUpper)
  def isIncludeLowercase(str: List[Char]): Boolean = str.exists(_.isLower)
  def isValid(str: List[Char]): Boolean = isLengthOver6(str) && isIncludeNumber(str) && isIncludeUppercase(str) && isIncludeLowercase(str)
}

