Each input line is supposed to be JSON. Print the parsed value re-stringified; if parsing throws, print INVALID for that line.
INVALID
Input: one or more lines. Output: one result per line.
Your program reads from stdin and prints to stdout.
Example 1
Input: {"a":1} not json [1,2]
Output: {"a":1} INVALID [1,2]
Hints