#C9902. Ticket Code Validator

    ID: 54047 Type: Default 1000ms 256MiB

Ticket Code Validator

Ticket Code Validator

You are given a ticket code string. Your task is to determine whether the ticket code is valid based on the following rules:

  • The ticket code must start with either FST or SND.
  • This prefix must be followed immediately by exactly 5 digits (0-9).

If any of these rules are not met, the ticket code is considered invalid. Formally, a valid ticket code satisfies the regular expression: $$^(FST|SND)\d{5}$$

The input is taken from stdin and output should be printed to stdout as either VALID or INVALID.

inputFormat

The input consists of a single line containing a string representing the ticket code.

Input is provided via standard input (stdin).

outputFormat

Output a single line: VALID if the ticket code meets the specified format, otherwise output INVALID.

Output is produced via standard output (stdout).

## sample
FST12345
VALID