TABLE5X5  Twofive
English  Tiếng Việt 
Having a 5×5table, we make a righttable by filling letters from 'A'..'Y' into the table satisfying:
 Each letter is used exactly one time.
 The letters is ascending on every row.
 The letters is ascending on every column.
Each righttable is described by a 25length string, see the example below for detail:
The righttable:
A  B  C  D  E 
F  G  H  I  J 
K  L  M  N  O 
P  Q  R  S  T 
U  V  W  X  Y 
is described by the string "ABCDEFGHIJKLMNOPQRSTUVWXY".
All descriptions are sorted ascending (following the dictionary order) and numbered from 1.
Task
 Give an order, find the right description.
 Give a description, find the right order.
Input
 The first line contains a number (an order).
 The second line contains a description.
Output
 The first line contains the 25length string desribing the order given.
 The second line contains the order of the given description.
Example
Input: 1 ABCDEFGHIJKLMNOPQRSTUVWXY Output: ABCDEFGHIJKLMNOPQRSTUVWXY 1
hide comments
smso:
20200306 18:53:23
more testcases:


[Trichromatic] XilinX:
20090516 01:03:37
You may set several test case in one test file and set the time limit to 1 second rather than 0.05 second per test.


AnhDQ:
20090515 21:51:01
Time limit has been updated to be like the root problem ;) someone missed AC :d 
Added by:  AnhDQ 
Date:  20090514 
Time limit:  0.100s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ERL JSRHINO NODEJS PERL6 VB.NET 
Resource:  IOI2001 