Fairy chess "leaper" movement patterns A leaper is a category of fairy chess piece which moves by "jumping."  A normal knight is a (1,2)-leaper, meaning each move involves moving a distance of 1 square in an orthogonal direction and 2 squares in the perpendicular direction.

.o.o.
o...o
..N..
o...o
.o.o.


There are many different leapers. The (1,3)-leaper is called the Long Knight, or Camel.  Its move pattern looks like this:

..o.o..
.......
o.....o
...L...
o.....o
.......
..o.o..


There's also the (2,2) Alfil...

o...o
.....
..A..
.....
o...o


...and even the (0,1) Wazir.

.o.
oWo
.o.


Challenge

Given a pair of numbers as input, output the corresponding movement diagram.  You may write a program or function, with input provided via STDIN/command-line or as an argument, and output provide by STDOUT or the return value. This is code-golf.

Input

Input will be a comma-separated list of two integers and an uppercase letter.  The two integers will be in the range 0-7 (inclusive) and in non-decreasing order. Trailing newline optional for input and output.

Here are the inputs for the above four examples:

1,2,N
1,3,L
2,2,A
0,1,W


Output

Output will be a square-shaped multiline string.  The capital letter will be placed in the center to represent the current location of the piece.  The movement locations will be represented by either 4 or 8 lowercase os.  All other spaces in the square will be filled with periods.

If the movement pattern is 0,0, output just the capital letter.

As a hint, if the second integer (the larger one) has value N, then the square will always have side length 2N+1.  The os will always be on the perimeter of the square.

Additional Testcases

1,1,F

o.o
.F.
o.o

5,7,Q

..o.........o..
...............
o.............o
...............
...............
...............
...............
.......Q.......
...............
...............
...............
...............
o.............o
...............
..o.........o..


0,0,J

J
Ruby,107
-&gt;a,b,n{(-b..b).map{|i|s='..'*b+?.
i%b==0&amp;&amp;(i==0?s[b]=n :s[b+a]=s[b-a]=?o)
i.abs==a&amp;&amp;s[0]=s[-1]=?o
puts s}}

Ungolfed in test program
f=-&gt;a,b,n{
  (-b..b).map{|i|                           #iterate from -i to i (lines of grit)
    s='..'*b+?.                             #make a string of 2n+1 .'s
    i%b==0&amp;&amp;(i==0?s[b]=n :s[b+a]=s[b-a]=?o) #if i%b=0 plot the centre character (if i=0) or the o's on the top and bottom rows
    i.abs==a&amp;&amp;s[0]=s[-1]=?o                 #if i.abs=a plot the o's in left and right columns
    puts s                                  #having substituted the .'s with o and centre as necessary, output the current line
  }
}

a=gets.to_i
b=gets.to_i
n=gets.chop
f[a,b,n]