SP18273 SNGINT - Encode Integer

Description

Given an integer N **(0 0)**, such that product of digits of M equals to N.

Input Format

First line input is T **(total no. of test cases)**, followed by T **(T < 10001)** lines containing integer N.

Output Format

For each N output M or -1 **(if encoding is not possible)** in each line.