下面是题目复述:

You are given three integers aa, bb and cc.

Find two positive integers xx and yy (x>0x > 0, y>0y > 0) such that:

the decimal representation of xx without leading zeroes consists of aa digits; the decimal representation of yy without leading zeroes consists of bb digits; the decimal representation of gcd(x,y)gcd(x, y) without leading zeroes consists of cc digits. gcd(x,y)gcd(x, y) denotes the greatest common divisor (GCD) of integers xx and yy.

Output

xx and yy. If there are multiple answers, output any of them.

Input

The first line contains a single integer tt (1t2851 \le t \le 285) — the number of testcases.

Each of the next tt lines contains three integers aa, bb and cc (1a,b91 \le a, b \le 9, 1cmin(a,b)1 \le c \le min(a, b)) — the required lengths of the numbers.

It can be shown that the answer exists for all testcases under the given constraints.

Additional constraint on the input: all testcases are different.

Output

For each testcase print two positive integers — xx and yy (x>0x > 0, y>0y > 0) such that

the decimal representation of xx without leading zeroes consists of aa digits;

the decimal representation of yy without leading zeroes consists of bb digits;

the decimal representation of gcd(x,y)gcd(x, y) without leading zeroes consists of cc digits.

Example

input

4

2 3 1

2 2 2

6 6 2

1 1 1

output

11 492

13 26

140133 160776

1 1

Note

In the example:

gcd(11,492)=1gcd(11, 492) = 1

gcd(13,26)=13gcd(13, 26) = 13

gcd(140133,160776)=21gcd(140133, 160776) = 21

gcd(1,1)=1gcd(1, 1) = 1

下面是解题思路:

题目大意:

输入三个数字a,b,c.

  • a表示数字x的位数
  • b表示数字y的位数
  • c表示数字gcd(x,y)的位数。

(gcd(x,y)表示x和y的最大公约数)

求出满足条件的x和y,输出一组即可。

思路:

暴力枚举,把a位数下面的所有数字和b位数下面的的所有数字枚举求最大公约数,然后得到答案。

需要注意的是,pow很可能数据丢失精确度,可以提前打表确定几位数的开始数字。

下面是AC代码:

#include <iostream>
#include <cstdio>
#include <cmath>

using namespace std;
bool flag=false;
int gcd(int a,int b)
{
    return b?gcd(b,a%b):a;
}
int bei[11];
void in()
{
    bei[0]=1;
    for(int i=1; i<10; i++)
        bei[i]=bei[i-1]*10;
}
int main()
{
    in();
    int t;
    scanf("%d",&t);
    while (t--)
    {
        int a,b,c;
        scanf("%d %d %d",&a,&b,&c);
        for(int i=bei[a-1]; i<=bei[a]; i++)
        {
            for(int j=bei[b-1]; j<=bei[b]; j++)
            {
                int ans=gcd(i,j),num=0;
                for(;ans>0;ans/=10) num++;
                if(num==c)
                {
                    printf("%d %d\n",i,j);
                    flag=true;
                    break;
                }
            }
            if(flag) break;
        }

    }
    return 0;
}