CF1511B.GCD Length

传统题 时间 2000 ms 内存 256 MiB 5 尝试 1 已通过 1 标签

GCD Length

You are given three integers aa, bb and cc.

Find two positive integers xx and yy (x>0x \gt 0, y>0y \gt 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 \gt 0, y>0y \gt 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.

Note

In the example:

  1. gcd(11,492)=1gcd(11, 492) = 1
  2. gcd(13,26)=13gcd(13, 26) = 13
  3. gcd(140133,160776)=21gcd(140133, 160776) = 21
  4. gcd(1,1)=1gcd(1, 1) = 1

Samples

4
2 3 1
2 2 2
6 6 2
1 1 1
11 492
13 26
140133 160776
1 1

在线编程 IDE

建议全屏模式获得最佳体验