Silly Substitutions

아직 제출이 없습니다메모리 제한1024 MB

문제

You are given a string SS of length NN which consists of digits 0-9. You do the following operations on the string in the order given.

  1. Find all the substrings 01 and replace each of them with 2.
  2. Find all the substrings 12 and replace each of them with 3.
  3. Find all the substrings 23 and replace each of them with 4.
  4. Find all the substrings 34 and replace each of them with 5.

.

.

.

  1. Find all the substrings 89 and replace each of them with 0.
  2. Find all the substrings 90 and replace each of them with 1.

You repeat this process in the same given order until none of the above operations change the string. For example, if SS is 12 then we do not stop at operation 11 since it does not affect the string but perform operation 22 and change the string to 3. We can see that the string does not change further no matter how many times we repeat the above process.

Your task is to find how the final string will look like for the given SS.

입력

The first line of the input gives the number of test cases, TTTT test cases follow. Each test case consists of two lines.

The first line of each test case contains an integer NN, denoting the length of the string SS.

The second line of each test case contains a string SS of length NN.

출력

For each test case, output one line containing Case #x: y, where xx is the test case number (starting from 1) and yy is the final string obtained.

제한

  • 1T1001≤T≤100.
  • The input string only consists of digits 0-9.