[Question]
  [
The [mid-autumn festival](https://en.wikipedia.org/wiki/Mid-Autumn_Festival) has begun!
Unfortunately, all my mooncakes were stolen -- they're getting too expensive for small folk such as myself, and I fear I won't be able to eat any this year!
So I turn to you for help. Would you be able to make me some? 
For those unaware, let me educate you on what a mooncake looks like.
---
Mooncakes come in many different sizes!  
So I'm gonna give you my **input**, *n*, when I want one.
Here are some examples of the **output** I want: 
Mooncake of size n = 3:
```
    (@@@@@)  
    (@MAF@) 
    (@@@@@) 
```
Mooncake of size n = 6:
```
    (@@@@@@@@@@@) 
    (@         @)
    (@    M    @) 
    (@    F    @)
    (@         @)
    (@@@@@@@@@@@) 
```
That is to say, a mooncake of size *n* is:
* *n* lines high
* *2n - 1* @s long
* *2n + 1* characters long (@s and brackets)
And you better not throw me your too-tiny practice mooncakes!  
**Assume input will always be n >= 3**. 
Mooncakes also **contain one of the following decorations**: 
* MF
* MAF
* HMF
* JCJ
* TTT
* ZJ
* LF
* RF
* CF
Which one, it doesn't matter - as long as it is **vertically and horizontally centered**.  
It can be written vertically or horizontally too!
I want variety!  
If you're really going to make me two of the same mooncake, the decoration better be different! 
That is, **multiple executions of your program with the exact same input must not always yield the same decoration**.
I can't wait to eat your moon cakes, so the sooner I can receive them (**the shorter your code**) the better!
Good Luck!
---
For those wondering about the decorations:  
They are the initials of all alternative names for the Mid-Autumn Festival.  
A list can be found in the Wikipedia page linked at the top of this post.
---
**Clarifications:**
*There are no rules regarding leading and trailing whitespace*.  
Have as much or as little as you like!
*The decorations must be in the very center of your mooncake!*  
On horizontal decorations, this means it must be on the middle line of your cake, and the number of characters to the left and right of the decoration string must be equal.  
On vertical decorations, this means it must reside in the middle column of your cake, and the number of characters above and below the decoration must be equal.
***Not all decorations must be used!***  
The only requirement is that there must be more than one possibility for any given input *n*. The possibilities also do not need to be even.
*Functions are acceptable.*
  
[Answer]
# Pyth, ~~71~~ ~~65~~ ~~59~~ 58 bytes
*Saved 1 byte thanks to @StevenH.*
```
jjRc"(@@)"2++J*KtytQ\@m.[Kd;.[ttQ@,,O"MC"\F]Oc"MAFHMF"3QkJ
```
[Try it online.](http://pyth.herokuapp.com/?code=jjRc%22(%40%40)%222%2B%2BJ*KtytQ%5C%40m.%5BKd%3B.%5BttQ%40%2C%2CO%22MC%22%5CF%5DOc%22MAFHMF%223QkJ&input=4&test_suite_input=3%0A4%0A5%0A6&debug=0) [Test suite.](http://pyth.herokuapp.com/?code=jjRc%22(%40%40)%222%2B%2BJ*KtytQ%5C%40m.%5BKd%3B.%5BttQ%40%2C%2CO%22MC%22%5CF%5DOc%22MAFHMF%223QkJ&input=4&test_suite=1&test_suite_input=3%0A4%0A5%0A6&debug=0)
So much padding.
[Answer]
## JavaScript ES6, ~~206~~ ~~196~~ ~~192~~ ~~188~~ ~~187~~ ~~180~~ ~~176~~ ~~169~~ ~~165~~ 156 bytes
```
g=(n,r=new Date%2,a=(s,x,b=' @'[+!s].repeat(n-3+!x))=>`(@${b+(s||'@')+b}@)
`,l=a` `.repeat(n/2-2+n%2))=>a()+l+(n%2?a(r?'MAF':'HMF',1):a('RC'[r])+a`F`)+l+a()
```
### Breakdown
```
r=new Date%2                           // Sometimes 0, sometimes 1
// Function to create lines of the cake of the form `(@@@@@@@@@)` or `(@  ${s}  @)`
a=(s,x,b=' @'[+!s].repeat(n-3+!x))=>`(@${b+(s||'@')+b}@)
`
// Cake parts
a()                                    // Top of the cake.
l=a` `.repeat(n/2-2+n%2)               // Undecorated inner part.
a(r?'MAF':'HMF',1)                     // Decoration for uneven sized cakes.
a('RC'[r])+a`F`                        // Decoration for even sized cakes.
l                                      // Undecorated inner part.
a()                                    // Bottom part.
```
My first attempt at code-golf. This can probably be golfed more. 
*saved 4 bytes thanks to @ETHProductions*
**Edit**
I took the liberty of using ~~`Date.now()%2`~~ `new Date%2` to satisfy:
> 
> multiple executions of your program with the exact same input must not always yield the same decoration
> 
> 
> 
this allows me to save another 7 bytes over `+Math.random()>.5`
*saved another 4 bytes thanks to @Arnauld*
[Answer]
# Pyth, ~~99~~ ~~79~~ ~~71~~ ~~68~~ 64 bytes
Pyth is ~~very bad~~ all right at making strings. Or maybe I'm just ~~bad~~ getting better at golfing them.
```
jmj.[-yQ3@,k@,@,O"MC"\FgydQOc"MAFHMF"3Q>2ahydQ@" @"sIcdtQc2"(@@)
```
Can create the decorations `MAF` and `HMF` horizontally, and the decorations `MF` and `CF` vertically.
[Try it online!](http://pyth.herokuapp.com/?code=jmj.%5B-yQ3%40%2Ck%40%2C%40%2CO%22MC%22%5CFgydQOc%22MAFHMF%223Q%3E2ahydQ%40%22+%40%22sIcdtQc2%22%28%40%40%29&input=6&debug=0)
[Answer]
# Vim, 118 bytes
Takes input as a buffer (e.g. a file with the number *n* as its contents).
```
"aDi()<Esc>@ai@<Esc>.xY@apddll<C-v>G$k3hr @=@a/2-1
j@=@a-2-@a%2
l:let r=abs(reltime()[1])%2
@=@a%2?r?"RJCJ":"3rT":"rFkr"."ML"[r]
<Esc>
```
Here it is with the unprintable control characters in xxd format:
```
0000000: 2261 4469 2829 1b40 6169 401b 2e78 5940  "aDi().@[[email protected]](/cdn-cgi/l/email-protection)@
0000010: 6170 6464 6c6c 1647 246b 3368 7220 403d  apddll.G$k3hr @=
0000020: 4061 2f32 2d31 0a6a 403d 4061 2d32 2d40  @a/2-1.j@=@a-2-@
0000030: 6125 320a 6c3a 6c65 7420 723d 6162 7328  a%2.l:let r=abs(
0000040: 7265 6c74 696d 6528 295b 315d 2925 320a  reltime()[1])%2.
0000050: 403d 4061 2532 3f72 3f22 524a 434a 223a  @=@a%2?r?"RJCJ":
0000060: 2233 7254 223a 2272 466b 7222 2e22 4d4c  "3rT":"rFkr"."ML
0000070: 225b 725d 0a1b                           "[r]..
```
[Try it online!](http://v.tryitonline.net/#code=ImFEaSgpG0BhaUAbLnhZQGFwZGRsbBZHJGszaHIgQD1AYS8yLTEKakA9QGEtMi1AYSUyCmw6bGV0IHI9YWJzKHJlbHRpbWUoKVsxXSklMgpAPUBhJTI_cj8iUkpDSiI6IjNyVCI6InJGa3IiLiJNTCJbcl0KGw&input=&args=OQ) (As it turns out, the V interpreter works fine for normal Vim code, too.)
# Explanation
```
"aD                   " Delete the number and store it in @a
i()<Esc>              " Insert empty parentheses
@ai@<Esc>.x           " Insert @a '@' characters between the parentheses twice; delete 1
Y@apdd                " Copy the line and paste it @a times; delete 1
ll<C-v>G$k3hr<Space>  " Replace the inner area with spaces
@=@a/2-1<CR>j         " Go down @a/2-1 lines
@=@a-2-@a%2<CR>l      " Go right @a-2-@a%2 columns
:let r=reltime()[1]%2<CR>  " Get a random 1 or 0 based on the time (this may be OS-dependent)
@=@a%2?
   r?"RJCJ":"3rT"     " For odd @a, replace the next 3 characters with "JCJ" or "TTT"
  :"rFkr"."ML"[r]     " For even @a, replace this character with "F" and the above with "M" or "L"
<CR><Esc>
```
[Answer]
# PHP, ~~342~~ ~~292~~ ~~249~~ ~~185~~ ~~178~~ 176 bytes
```
for(;$i<$n=$argv[1];)$o.=str_pad("(@",2*$n-1," @"[$i++%($n-1)<1])."@)
";$p=F.[M,AM,R,MH][rand()&2|$d=$n&1];$f=$n*($n+$d)-2;for($i=2+$d;$i--;$f+=$d?:2*$n+2)$o[$f]=$p[$i];echo$o;
```
Call with `php -r '<code>' <size>`
**history**
Rev 1: initial version; all sizes (including tiny cakes), all decorations, all possible directions
Rev. 2: removed tiny cakes (-36 bytes), restructured decoration options, removed one decoration item (-21) and a single byte golf (-1).
Rev. 3: Down to four decorations; (-17), only horizontal for odd sizes (-18) plus minor golfing (-8).
Rev. 4: Thanks to Jörg for golfing down the "paint cake" part; he took off an amazing (-31).  
Another -6 with my additional golfing, and -27 for using a single string instead of an array of strings.
Rev. 5: -7 bytes mostly thanks to Christallkeks
**breakdown**
This is getting slimmer by the hour. :)
```
// paint cake
for(;$i<$n=$argv[1];)$o.=str_pad("(@",2*$n-1," @"[$i++%($n-1)<1])."@)\n";
// add deco
$p=F.[M,AM,R,MH][rand()&2|$d=$n&1];
$f=$n*($n+$d)-2;
for($i=2+$d;$i--;$f+=$d?:2*$n+2)$o[$f]=$p[$i];
// output
echo$o;
```
[Answer]
# Java 7, ~~399~~ 349 bytes
Updated version with help from @Dodge and @Kevin Cruijssen:
```
void m(int n){int i=2,r=n%2,x=2*n,u=r+2,y=r*4+(int)(Math.random()*2)*u,z=y+u;String t="MFZJMAFHMF".substring(y,z);char[][]c=new char[n][x+1];while(i<x-1)c[0][i]=c[n-1][i++]=64;for(i=0;i<u;)c[(n-1)/2+(1-r)*i][r*(i-1)+n]=t.charAt(i++);for(i=0;i<n;){c[i][0]=40;c[i][1]=c[i][x-1]=64;c[i][x]=41;System.out.println(new String(c[i++]).replace('\0',' '));}}
```
```
void m(int n){String[]s={"MF","MAF","ZJ","HMF","LF","JCJ","RF","TTT","CF","MAF"};char[]d=s[((int)(Math.random()*5))*2+(n%2)].toCharArray(),c[]=new char[n][2*n+1];int i=2;while(i<2*n-1)c[0][i]=c[n-1][i++]='@';i=0;while(i<d.length)c[(n-1)/2+(1-(n%2))*i][(n%2)*(-1+i)+n]=d[i++];i=0;while(i<n){c[i][0]='(';c[i][1]=c[i][2*n-1]='@';c[i][2*n]=')';System.out.println(new String(c[i++]).replace('\0',' '));}}
```
[Try it here!](https://ideone.com/yQ1fgg)
The new version is much more optimized and got rid of the `String` array handling. Also as suggested, there are only 4 decorations now: 2 for even inputs (`MF`,`ZJ`) and 2 for odd inputs (`MAF`,`HMF`) which are combined into a single `String`.
**Ungolfed:**
```
void m(int n){
    int i=2,
    r=n%2,
    x=2*n,
    u=r+2, // length of the decoration string
    y=r*4+(int)(Math.random()*2)*u, // random starting index of string (0, 2, 4, 7)
    z=y+u; // exclusive end index of string (2, 4, 7, 10)
    String t="MFZJMAFHMF".substring(y,z);
    char[][]c=new char[n][x+1];
    while(i < x-1) {
        c[0][i]=c[n-1][i++]=64; // '@'
    }
    for(i=0; i<u;) {
        c[(n-1)/2+(1-r)*i][r*(i-1)+n]=t.charAt(i++); // Depending on even/odd, fills the center column/row respectively with the decoration
    }
    for(i=0; i<n;) {
        c[i][0]=40; // '('
        c[i][1]=c[i][x-1]=64; // '@'
        c[i][x]=41; // ')'
        System.out.println(new String(c[i++]).replace('\0',' ')); // Print all
    }
}
```
[Answer]
## Batch, 386 bytes
```
@echo off
set/pn=
set f=HMAC
set/ao=n%%2,u=n/2,l=h=u+1,d=%random%%%2*2+1
if %o%==1 set/al=u=0,d/=2
set c=
for /l %%i in (4,1,%n%) do call set c= %%c%%
call:l %n%
for /l %%i in (2,1,%n%) do call:l %%i
exit/b
:l
set s=   
if %1==%h% call set s=%%f:~%d%,2%%F
if %1==%u% call set s= %%f:~%d%,1%% 
if %1==%l% set s= F 
set s=(@%c%%s%%c%@)
if %1==%n% set s=%s: =@%
echo %s%
```
Will only output HMF, MAF, MF or CF as appropriate. Note: certain lines end in white space. Variables:
* `n` Input parameter (read from STDIN)
* `f` Decoration prefixes (suffix `F` is implied)
* `o` Oddness of `n` (only used once, but `if` statements don't accept expressions)
* `l` Row of the upper vertical character, or `0` for a horizontal decoration
* `u` Row of the lower vertical character, or `0` for a horizontal decoration
* `h` Row of the horizontal decoration (gets overwritten by a vertical decoration)
* `d` Index of decoration in decoration prefix (0/1 for horizontal or 1/3 for vertical)
* `c` String of `n-3` spaces
* `s` Output string for each row
* `%1` Row number, but set to `n` for the first row too, so that both first and last rows use `@`s instead of spaces.
[Answer]
# C, 233 Bytes
Should be able to golf this down a bit from here...
```
A="HMFMAFCF";i,j,k,t;f(n){t=time();char*S=n&1?t&1?A:A+3:t&1?A+1:A+6;for(;i<n;i++,puts(")"))for(j=0,k=2*n-1,putchar(40);j<k;putchar(0==i*j|i==n-1|j==k-1?64:n&1&i==n/2&j>n-3&j<n+1?*S++:n&1?32:(i==n/2-1|i==n/2)&j>n-2&j<n?*S++:32),j++);}
```
Great challenge, this was difficult and ugly to code.
Run with this main func;
```
main(c,v)char**v;
{
    f(atoi(v[1]));
}
```
[Answer]
# Ruby 2.3.1, ~~449~~ ~~265~~ ~~245~~ ~~233~~ 230 characters
Seems like there should be a ruby answer, so here is a ruby answer. It's really not that clever, Hopefully someone else here will be more clever ;)
Golfed version:
```
def m(n)
d,s=n.odd?? [[%w{MAF HMF}.sample],n/2]:[%w{RF LF}.sample.chars,(n-2)/2]
r=->f{l=f.size;q=($i-l)/2;($c=' '*$i)[q...l+q]=f;puts "(@#$c@)"}
$i=2*n-1;a='@'*$i
r[a]
(1..n-2).map{|x|(s...s+d.size)===x ?r[d[x-s]]:r['']}
r[a]
end
```
Golfing tricks:
* replace method declaration with a stabby string interpolation of
* $globals doesn't need #{global}, only #$global
* === for ranges is shorter than .covers?
Readable version
```
def row(inner_width, fillchar='')
  padding = ( inner_width - fillchar.size) / 2
  (center =(' ' * inner_width))[padding...fillchar.size+padding]=fillchar
  puts "(@"+center+"@)"
end
def mooncake(n)
  decoration = n.odd?? [%w{ MAF HMF JCJ TTT }.sample] : %w{ ZJ LF RF CF }.sample.chars
  start_row = n.odd?? (n/2) : (n - 2) / 2
  inner_width = 2 * n - 1
  row(inner_width,'@'*inner_width)
  (1...(n-1)).each do |row|
    if (start_row ... start_row + decoration.size).include? row 
      row(inner_width,decoration[row - start_row])      
    else
      row(inner_width)      
    end
  end
  row(inner_width,'@'*inner_width)
end
```
Testing
```
mooncake(3)
mooncake(4)
mooncake(5)
mooncake(6)
```
[Answer]
I was bored ... here are two more versions:
# PHP, 193 bytes
```
function p($s){global$n;return"(@".str_pad($s,2*$n-3,$s?" ":"@",2)."@)
";}$p=[M,MA,R,HM][rand()&2|1&$n=$argv[1]];echo p(""),$e=str_repeat(p(" "),($n+$n%2)/2-2),$n&1?p($p.F):p($p).p(F),$e,p("");
```
a port of [Lmis´ answer](https://codegolf.stackexchange.com/q/93348#93348)
# PHP, 191 bytes
```
for($p=[M,MA,R,HM][rand()&2|1&$n=$argv[1]].F;$i<$n*$w=2*$n+1;$i++)echo($x=$i%$w)?$w-1-$x?($y=$i/$w|0)%($n-1)&&1-$x&&$w-2-$x?$p[$n&1?$n>>1!=$y?9:$x-$n+1:($n-$x?9:$y-$n/2+1)]?:" ":"@":")
":"(";
```
printing the cake character by character in a single loop
**breakdown**
```
for(
    $p=[M,MA,R,HM][rand()&2|1&$n=$argv[1]].F;   // pick decoration
    $i<$n*$w=2*$n+1;$i++)       // loop $i from 0 to $n*width-1:
echo                                // print ...
    $w-1-($x=$i%$w)                 // 1. not last column
        ?$x                         // 2. not first column
            ?
                ($y=$i/$w|0)%($n-1) // 3. not first or last line
                && 1-$x%($w-3)      // and not second or (width-2)th column
                ?$p[$n&1
                    ?$n>>1!=$y?3:1+$x-$n
                    :($n-$x?3:1+$y-$n/2)
                ]   ?               // 4. decoration character
                    :" "            // 4. else: blank
                :"@"                // 3. else: "@"
            :"("                    // 2. else: "("
        :")\n"                      // 1. else: ")"+newline
    ;
```
[Answer]
# Python 3, ~~318~~ ~~301~~ ~~297~~ ~~285~~ 272 bytes
**Knocked off 17 bytes with the help of DJMcMayhem**
**Knocked off 4 bytes thanks to mbomb007**
**Knocked off another 12 bytes thanks to DJMcMayhem**
**Knocked off another 13 bytes thanks to mbomb007**
My first golf ever, so it's not all that great. I used: aliasing math.ceil as y and str.format as z, nesting formats, single line imports, lambda, and bitwise operation plus some other things to get this like it is.
```
def f(n):import random,math;y=math.ceil;z=str.format;i=y(2*n-5>>1);j=y(n-3>>1);return z("{a}{}{a}",z("{d}(@{}{b}F{c}@)\n{e}"," "*i,b=random.sample(["L","R"],1)[0],c=" "*(2*n-5-i),d=z("(@{}@)\n"," "*(2*n-3))*j,e=z("(@{}@)\n"," "*(2*n-3))*(n-3-j)),a=z("({})\n","@"*(2*n-1)))
```
Ungolfed version (separated imports, no aliases, and no bitwise operation):
```
def f(n):
    import random;
    import math;
    return "{a}{}{a}".format(
        "{d}(@{}{b}F{c}@)\n{e}".format(
            " "*(math.ceil((2*n-5)/2)),
            b=random.sample(["L","R"],1)[0],
            c=" "*((2*n)-(5+math.ceil((2*n-5)/2))),
            d="(@{}@)\n".format(" "*(2*n-3))*math.ceil((n-3)/2),
            e="(@{}@)\n".format(" "*(2*n-3))*(n-(3+(math.ceil((n-3)/2))))),
        a="({})\n".format("@"*(2*n-1)))
```
Interestingly, using the non-bitwise version of this still produces correct output, however, the output is different:
Non-Bitwise:
```
(@@@@@@@)
(@     @)
(@  LF @)
(@@@@@@@)
```
Bitwise:
```
(@@@@@@@)
(@ LF  @)
(@     @)
(@@@@@@@)
```
[Answer]
# C# 448 bytes
Golfed:
```
var v=n%2==0;int l=n+n-3,h=n-2,e=v?0:1,c=e+2;var c2=v?"MFZJLFRFCF":"MAFHMFJCJTTT";var r=new Random().Next(3+e);var f=new String(c2.Skip(c*r).Take(c).ToArray());var mc="";for (var i=0;i < h;i++) {var x="";if (!v && i==((h / 2))) { x=f;} else if (v && ((i==h / 2) || (i==(h/2)-1))) { x +=f[i%2==1?0:1];} var es=x.PadLeft((l/2)+1+e,' ').PadRight(l,' ');mc +="(@"+es+"@)\n";}var b="("+"".PadLeft(l+2, '@')+")";mc=b+"\n"+mc+ b; Console.WriteLine(mc);
```
Test it [here](http://rextester.com/EQOSI4698)
Ungolfed:
```
        var v = n % 2 == 0;
        int l = n + n - 3, h = n - 2, e = v ? 0 : 1, c = e + 2;
        var c2 = v ? "MFZJLFRFCF" : "MAFHMFJCJTTT";
        var r = new Random().Next(3 + e);
        var f = new String(c2.Skip(c * r).Take(c).ToArray());
        var mc = "";
        for (var i = 0; i < h; i++)
        {
            var x = "";
            if (!v && i == ((h / 2)))
            {
                x = f;
            }
            else if (v && ((i == h / 2) || (i == (h / 2) - 1)))
            {
                x += f[i % 2 == 1 ? 0 : 1];
            }
            var emptySpace = x.PadLeft((l / 2) + 1 + e, ' ').PadRight(l, ' ');
            mc += "(@" + emptySpace + "@)\n";
        }
        var b = "(" + "".PadLeft(l + 2, '@') + ")";
        mc = b + "\n" + mc + b;
        Console.WriteLine(mc);
```
]