#Lutece0153. 虫食算
虫食算
Migrated from Lutece 153 虫食算
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
虫食算,是指在一条算式里,有大量的“洞”,要求玩家填上数字的一种趣题。这些洞像虫咬掉的,故名。
现在考虑一种简单的情况,其中、、都是没有前导零的自然数,被虫啃掉的数字用?
代替,你能恢复出整个算式吗?
Input
输入第一行为整数(),表示测试数据组数。
以下行每行一个字符串,的长度小于等于,表示待恢复的算式。
算式保证符合的形式,且、、仅由数字和?
组成。
Output
如果有多解,输出其中最大的解
如果还有多解,输出其中最大的解
如果无解,输出Impossible
Samples
2
?+?=?
9+?=?1
9+0=9
9+2=11
Resources
Classic Problem