# Multiplicative Persistence
## Problem Statement
The **multiplicative persistence** of a positive integer $n$ is defined as the number of times you must multiply its digits together before reaching a single-digit result.
For example:
- If $n = 10$, the product of its digits is $1 \times 0 = 0$. Since $0$ is a single-digit number, the process stops after $1$ round. Thus, the multiplicative persistence of $10$ is $1$.
- If $n = 27$, the process is as follows:
1. $2 \times 7 = 14$
2. $1 \times 4 = 4$
The process takes $2$ rounds to reach the single-digit number $4$. Thus, the multiplicative persistence of $27$ is $2$.
- If $n = 9$, the number is already a single-digit number, so the process takes $0$ rounds. Thus, the multiplicative persistence of $9$ is $0$.
Given a list of positive integers $a_1, a_2, \dots, a_n$, for each $a_i$, find the smallest integer $x > a_i$ such that the multiplicative persistence of $x$ is exactly $1$.
## Input Format
- The first line contains an integer $n$ ($1 \le n \le 10^5$), representing the number of integers in the list.
- The second line contains $n$ space-separated integers $a_1, a_2, \dots, a_n$ ($1 \le a_i \le 10^9$).
## Output Format
- Print $n$ space-separated integers, where the $i$-th integer is the smallest value $x > a_i$ whose multiplicative persistence is exactly $1$.
## Sample Test Cases
### Sample Input 1
```
3
10 27 9
```
### Sample Output 1
```
11 30 10
```
### Sample Input 2
```
2
77 99
```
### Sample Output 2
```
80 100
```
## Constraints
| Constraint | Value |
| :--- | :--- |
| Number of queries ($n$) | $1 \le n \le 10^5$ |
| Value of each integer ($a_i$) | $1 \le a_i \le 10^9$ |
| Time Limit | 1 second |
| Memory Limit | 256 MB |
## Explanation
- **For $a_1 = 10$**: The next number is $11$. The product of digits of $11$ is $1 \times 1 = 1$, which is a single-digit number. This takes $1$ round, so the persistence is $1$.
- **For $a_2 = 27$**:
- $28$: $2 \times 8 = 16 \to 1 \times 6 = 6$ (Persistence $2$)
- $29$: $2 \times 9 = 18 \to 1 \times 8 = 8$ (Persistence $2$)
- $30$: $3 \times 0 = 0$ (Persistence $1$)
The smallest number greater than $27$ with persistence $1$ is $30$.
- **For $a_3 = 9$**: The next number is $10$. $1 \times 0 = 0$ (Persistence $1$).
Loading problem statement...