[Question]
  [
[Gimbap](https://en.wikipedia.org/wiki/Gimbap)(김밥) is Korean food, somewhat looks like sushi roll.
Here is Korean emoticon represent Gimbap : `@))))))))))`
Your quest is make ASCII Gimbap cutter.
# Rule
Input is string made with only `@` and `)`.
Output *cuts* every valid Gimbap with `)`, and then add  `@` between them. So for example `@))` to `@) @)`.
*Valid Gimbap* starts with `@` and followed by any amount of `)`.
If there is no valid Gimbap, output is blank.
# Input and output
```
Input | Output
@))))) | @) @) @) @) @)
@))))))) | @) @) @) @) @) @) @)
@))@))) | @) @) @) @) @)
@) | @)
)) | 
@ | 
@@)@@@))) | @) @) @) @)
@)@)@)) | @) @) @) @)
@@@)) | @) @)
))@) | @)
```
# Winning condition
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shortest code wins.
from [sandbox](https://codegolf.meta.stackexchange.com/a/17750/87110)
  
[Answer]
# [Haskell](https://www.haskell.org/), 32 bytes
```
f(')':s)=f s
f s=do ')'<-s;"@) "
```
[Try it online!](https://tio.run/##fZDBboMwEETv/oqRVSlYMafc2iD50q9AHKwUUlQwVtZcqn573XXBCq2SYCx5583Oyn639NEOQ4xdsVO7Z1JVBxK8q7cJrBxLepFGQcbQUiBUqAuu0yc1Etn8Umlkeov/c5mHIQtZqsW3ks3RKGNupOSItO4wsyV5yHVoI0TROz8H0gj2cm4DKb777D57j9@XENMcEmd1tB4dFrsYbe9Y85feBTyhqFOO5gzNDerrT4VjCQ48rL15EtZoDTeF16Edk4A6dSXLfi8hm0Znm4rfp26wZ4rlyfsf "Haskell – Try It Online")
Recursion beats using `span` for removing the initial `(`'s.
**[Haskell](https://www.haskell.org/), 33 bytes**
```
f s=do ')'<-snd$span(<'@')s;"@) "
```
[Try it online!](https://tio.run/##fZDBjoIwFEX3fMVNYwKNZTVLMenGryAsGgUlQml4ZWP89um0A41o1LaLvnfuuzftRdG17jrnGtD@NCDlaZGTPm3IKJ0VqUw57ZjkYM7WZAl7lJmvw2ICgawO4wKRvuMvKvnVZCZzNesWsrpKLuUbl2gR9gcm1ySGPEKrJMlabSZLAlaN59oS92@f9K01@P@JZJhs4L7bK4MGszzpVat9z4ytttggK4OP8B7CD/D7U4Uihzf8WWZjEhZrAT3YQ1f3oYEyTAXJdsvAqkpEGXe/x6ZTZ3L50Zg/ "Haskell – Try It Online")
[Answer]
# JavaScript, ~~42~~ 41 bytes
```
s=>s.split(/(?<=@.*)\)/).fill``.join`@) `
```
[Try It Online!](https://tio.run/##FcZBCoAgEEDRq0QrJ2i8QJYHaaGYhjE40kjXt1r8x7/84yXcuba58BF7Ml3MKiiVclNabYuxOMEOGjBlIufw4lychcH1wEWYIhKfKqkRAOzfx/f9BQ)
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 53 bytes
```
i;f(char*_){for(i=1;*_;!i&*_++&&printf("@) "))i&=*_;}
```
[Try it online!](https://tio.run/##RY7BCoMwEETv@Yo0h5A1lrbnbSD/ISISmnYPVdH0UvHb08RauwvDg5mBcce7czESeuUe7Vg0MPt@VGQuWDR4IFk0Wks5jNQFr4QFLgBImmQu8dlSp2Bma5MHV9VmZimTT5Q/2tnumHXjVSxY@3fzf9FukLuCLcjSNq7SFE7mjHSd6H3rvQoOThuuUwBJ63J4hUmJ1GU5UVENyJb4AQ "C (gcc) – Try It Online")
```
i;f(char*_){for(    *_;                      )      }   //loop over the string:
                i=1;   !i&                    i&=*_;    //skip leading `)`s
                       !i&*_++&&printf("@) ")           //and print "@) "for each `)` thereafter
```
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), ~~48~~ 47 bytes
```
x=>"@) ".repeat(x.split(/(?<=@.*)\)/).length-1)
```
[Try it online!](https://tio.run/##dVDNCsIwDL73KcpOrbBOzzoNgk@hQuus26SupatjB9@9dh3iYJqEQL4fQnIXnWgLWxuXNvoqfScsLuvHRZj90ylpcY59n28ToDhhVhopHOlZa1TtSEZ2mxzYgp5oRpmSTemqdEX9mgMdAr9wsE0KjfgP5svDH2PEUOQQxAYUYK4O0iFnKEwwNKyJAx9P4Yizm7YHUVSkx/kWF7pptZJM6ZJM3/G5nQc3Py7PYb1/Aw "JavaScript (Node.js) – Try It Online")
# [JavaScript (Node.js)](https://nodejs.org), ~~53~~ 49 bytes
```
x=>[...x].map(y=>y<"0"?m+=s&&"@) ":s=1,s=m="")&&m
```
[Try it online!](https://tio.run/##dVDdCoIwFL7fU4xdDEc17LaajaCnEGHLrAznxmai0LsvXUGCdc7hwPl@@ODcZStdbkvTrGp9LnwrLbyW6iTN4dFUhYUM@o4lKaW0y6iSJupZ0u9QjPZqwRzGiBOINo6tl44phhDBWPmt4GQs@IQDPRnwxn8wX57/MQYMBA7wsDjhfK4epGPPUD7BwBgTDkGdqcpGAEEv2h5lfos6yBKY69rpqqCVvkbTh0TdxzC4RRpnQ7x/AQ "JavaScript (Node.js) – Try It Online")
# [JavaScript (Node.js)](https://nodejs.org), 60 bytes
```
x=>x.replace(/(@?)(\)*)/g,(_,a,b)=>a&&b.replace(/./g,"@) "))
```
[Try it online!](https://tio.run/##dZBRC4IwFIXf9ytGD7IbNnsP7RL0KyratGXGcjJN9tB/t2mBgnU3BvvOORy4d9nKOrNF1axKc1FdKy3Ni0cqq92z0crSmHYuThy3qtIyUyxiuAV2hCVEecjOoQxTiBMZBOlo4V5aINAFQLcRCP3QF/VkcsmH/1BGHf8EB0YGjeDwICDO3d7anxnFCSN9zfARvK500Qgi@NXYvcxuzNE4oZkpa6MV1yZn090w9w34tDisT76@ewM "JavaScript (Node.js) – Try It Online")
[Answer]
# [Canvas](https://github.com/dzaima/Canvas), ~~10~~ 9 [bytes](https://github.com/dzaima/Canvas/blob/master/files/chartable.md)
```
@ｓｊ∑Ｌ@) ×
```
[Try it here!](https://dzaima.github.io/Canvas/?u=QCV1RkY1MyV1RkY0QSV1MjIxMSV1RkYyQ0AlMjklMjAlRDc_,i=JTI5JTI5JTI5JTI5JTI5QCUyOSUyOUAlMjklMjklMjk_,v=8)
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 14 bytes
```
^\)+|@
\)
@) 
```
[Try it online!](https://tio.run/##K0otycxL/K@q4Z7wPy5GU7vGgYsrRpPLQVPh/38HTRDgglAQhgOE5gKRXA4Omg4OUBEQBNIgLhdIGQA "Retina 0.8.2 – Try It Online") Link includes test cases. Explanation:
```
^\)+|@
```
Delete leading `)`s and all `@`s.
```
\)
@) 
```
Replace all `)`s with `@)`s. (Note: trailing space.)
[Answer]
# [Python 2](https://docs.python.org/2/), 39 bytes
```
lambda s:'@) '*s.lstrip(')').count(')')
```
[Try it online!](https://tio.run/##dY7RCsIgGIXvfYqf3ag1BnU5GPgWXVTEqq0JpqKOEfTu9mtBg5WKHL9zPGofYTB6G/vmEFV7P19b8DUVHOjKV8oHJy2jnPLqYkYdsozTIFUHm5qALyFAA66dTlLbMTBeeask5uAJlBNwnUe/Zx61dVKHRAjIHrTJGqSGfcCaNQV6xMpPrNg5o291UQLDVBl4FDwN7MXPzRZ58x/O1xd/LmZGskdE3gQXYpnGaJoLKmaMpGfy4QU "Python 2 – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 8 bytes
```
ṣṀḊẎ”@pK
```
[Try it online!](https://tio.run/##y0rNyan8///hzsUPdzY83NH1cFffo4a5DgXe////1wQBAA "Jelly – Try It Online")
-1 thanks to [Jonathan Allan](https://codegolf.stackexchange.com/users/53748/jonathan-allan).
[Answer]
# [Perl 5](https://www.perl.org/) `-p`, 26 bytes
```
$_=s/^.*?@//&&'@) 'x y/)//
```
[Try it online!](https://tio.run/##dY3RCsIwDEXf@xUBZbOC1hefRMx/iMqQ6ipbW9oMFfx2a1sFB9MkBHLuTWKla5ZhfFhPvG0UCRB8u9itYASXzhOcjAPXaa30GaiWQDLCY@Wlh6ui2nQETkZTWxF9PG265sV@Pt2gEEVRIofyBnfBhQgBeQp4QKS9Ym/@Q/nq@GcxM5Y1hrkhRxy6ozXlgGKPsfQmD09jSRntw8w2Lw "Perl 5 – Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 12 bytes
```
')Û'@KS'@ìðý
```
[Try it online!](https://tio.run/##yy9OTMpM/f9fXfPwbHUH72B1h8NrDm84vPf/fwcHTQcg1tT8r6ubl6@bk1hVCQA "05AB1E – Try It Online")
**Explanation**
```
')Û            # trim leading ")"
   '@K         # remove all "@"
      S        # split to list of characters
       '@ì     # prepend "@" to each
          ðý   # join on spaces
```
[Answer]
## Batch, 58 bytes
```
@set s=%1@
@set s=%s:*@=(%
@set s=%s:@=%
@echo%s:)=@) %
```
Takes input as a command-line parameter. Explanation:
```
@set s=%1@
```
Suffix an `@` in case the input doesn't contain any.
```
@set s=%s:*@=(%
```
Delete up to the first `@`, replacing it with a `(` to ensure that the string is not empty (because `%:%` doesn't work on empty strings). The `(` also makes the `echo` work if the rest of the string is empty.
```
@set s=%s:@=%
```
Delete any remaining `@`s.
```
@echo%s:)=@) %
```
Expand any remaining `)`s.
[Answer]
# [05AB1E (legacy)](https://github.com/Adriandmen/05AB1E/tree/fb4a2ce2bce6660e1a680a74dd61b72c945e6c3b), 10 bytes
```
Z¡¦JS'@ìðý
```
[Try it online!](https://tio.run/##MzBNTDJM/f8/6tDCQ8u8gtUdDq85vOHw3v//NTUdHIDIQVNTEwA "05AB1E (legacy) – Try It Online")
[This bug](https://chat.stackexchange.com/transcript/message/50573719#50573719) forces me to use the legacy version. This is the code for the current version of 05AB1E (11 bytes):
```
'@¡¦JS'@ìðý
```
[Try it online!](https://tio.run/##yy9OTMpM/f9f3eHQwkPLvILVHQ6vObzh8N7//zU1HRyAyEFTUxMA "05AB1E – Try It Online")
Port of my Jelly answer.
[Answer]
# [Japt](https://github.com/ETHproductions/japt) v2.0a0 [`-S`](https://codegolf.meta.stackexchange.com/a/14339/), 15 bytes
```
r/^\)+|@/ ¬mi'@
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=2.0a0&flags=LVM&code=ci9eXCkrfEAvIKxtaSdA&input=IkBAKUBAQCkpKSI)
```
r/^\)+|@/ ¬mi'@     :Implicit input of string
r                   :Remove
 /^\)+|@/           :  "@"s and leading ")"s
          ¬         :Split
           m        :Map
            i'@     :  Prepend "@"
                    :Implicit output, joined with spaces
```
## Alternative
```
e/^\)/ è\) Æ"@)
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=2.0a0&flags=LVM&code=ZS9eXCkvIOhcKSDGIkAp&input=IikpKUBAKUBAQCkpKSI)
```
e/^\)/ è\) Æ"@)     :Implicit input of string
e                   :Recursively remove
 /^\)/              :  Leading ")"
       è\)          :Count remaining ")"s
           Æ        :Map the range [0,Count)
            "@)     :  Literal string
                    :Implicit output, joined with spaces
```
[Answer]
# [brainfuck](https://github.com/TryItOnline/brainfuck), 49 bytes
```
,[[-<+>>++++<]>[[-]<<<[[.>]<---------.[-]]>[-]],]
```
[Try it online!](https://tio.run/##SypKzMxLK03O/v9fJzpa10bbzk4bCGxi7YC8WBsbm@hoPbtYG10Y0AOKAuWAhE7s//8ODpoOQKypCQA "brainfuck – Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt) v2.0a0 [`-P`](https://codegolf.meta.stackexchange.com/a/14339/), 15 bytes
```
f/@\)+/ ËÅç"@) 
```
Saved 2 bytes thanks to @Shaggy.
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=2.0a0&flags=LVA&code=Zi9AXCkrLyDLxeciQCkg&input=IkBAKUBAQCkpKSI)
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 12 bytes
```
œl”)ḟ”@⁾@ jⱮ
```
[Try it online!](https://tio.run/##y0rNyan8///o5JxHDXM1H@6YD6QcHjXuc1DIerRx3f///zU1HRw0gQBIAAA "Jelly – Try It Online")
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), 34 bytes
```
{~map {'@)'xx.chars-1},m:g/\@\)+/}
```
[Try it online!](https://tio.run/##dY/NjoIwFIXX9iluDBmsOjBsZqExuVs38wLIosF2hqQgoZhAGHx1vFSCxJ/@pf3uOeemuSz0d5fWH2rXNZdU5NC4yN2q8uI/UZjPoF2nm1//gAe@8ttuy9SpAGe5//F0kkkDDZul/sJbcnDhn3Z/9bcEa3CSDHZwcb6Gp6xyGZfyaGEwQBGXZ6EJqQXpOdFETaSZHCXUaWZEDXMlEr0BCg/JEcGoDUdbBIMnHMzRnIJbkNrIe04ujJnknM7lg561HfJ@0M@QTxe78ReVex3fGC1jtsbQHsgRn9Uk7ecTxQljfRv7uAI "Perl 6 – Try It Online")
[Answer]
# [Ruby](https://www.ruby-lang.org/) `-p`, 28 bytes
```
$_= ~/@/&&'@) '*$'.count(?))
```
[Try it online!](https://tio.run/##LYoxDoAwDAP3viJDRQgC@gIgP0GCBQbaCsrAwtMJRMWWfE7k/ZwuifvqE1hXgx3beQlbrAGhBxQ7dnA7dkWBTICVxXYOp0/lQCTCpDIZuXCm0TTMxPx/1B/1NDp7Qkxr8Ic08QU "Ruby – Try It Online")
**Explanation**
```
                                # -p gets a line of STDIN
$_=                             # Set output to
    ~/@/                        # Find first '@' in input
                                # nil (falsey) if not found
        &&                      # If found, set output to
          '@) '                 # Sliced gimbap
               *                # Repeat
                $'              # In the string after the first '@',
                  .count(?))    # ... count the number of ')'
                                # -p outputs the contents of $_
                                # nil outputs as a blank string
```
[Answer]
# Java 10, 49 bytes
```
s->s.replaceAll("^\\)+|@+","").replace(")","@) ")
```
[Try it online.](https://tio.run/##bVDLjgIhELz7FZ0@0Zl1PkCzhv2A9eLRR8IiGlzEydBjYtRvH2HEg85AQqgquqjugzqr8WH732qnQoBfZf11BGA9m3qntIF5ggALrq3fgxb5Emga@fsoHoEVWw1z8PANbRjPQlmbysXiH@cEblYrKm6ywC9EeikCKWJJgNROk0nV/Llokr3OJ7uFY8ySv1uuQdEzCJvAIlamhV2Id26AlQPkO@7pH1CSlEMuaX@SskelBNibV9dj9yCP1Pqq4dzl4hLYHMtTw2UVRXZedHKBE8DCl/oJKbve2wc)
[Answer]
# [sed](https://www.gnu.org/software/sed/), 30 bytes
```
s/)\?@\()\?\)/\1/g; s/)/@) /gp
```
[Try it online!](https://tio.run/##K05N0U3PK/3/v1hfM8beIUYDSMZo6scY6qdbKwDF9B00FfTTC/7/19R0ACIg1vyvmwcA "sed – Try It Online")
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), ~~91~~ ~~90~~ ~~85~~ ~~71~~ ~~70~~ ~~59~~ 57 bytes
```
StringReplace@{(StartOfString~~")"..)|"@"->"",")"->"@) "}
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE7876Zg@z@4pCgzLz0otSAnMTnVoVojuCSxqMQ/DSJcV6ekqaSnp1mj5KCka6ekpAPkAmkHTQWl2v8BQBUlDlpuCvoOCtVAMRBQ0lGAsuBsBzgTRELZYMJB08EBIQuCEKYDlAHSC7QHAA "Wolfram Language (Mathematica) – Try It Online")
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 20 bytes
```
*?}\@z/>zxz\@\)0"@) 
```
[Try it online!](http://pythtemp.herokuapp.com/?code=*%3F%7D%5C%40z%2F%3Ezxz%5C%40%5C%290%22%40%29+&input=%29%40%29%29%40%29%29%29&debug=0) Note that there is a trailing space at the end of the program. This one is (or rather, started out as) a rather direct translation of the Python 2 answer (though the lstrip part was surprisingly difficult).
Explanation:
```
*            # repeat string
  ?          # repeat count: ternary
    }\@z     # condition: check whether input contains @
    /        # if condition is true: count occurrences of one string in another
      >      # array slice: all elements of array (or string) from a specific index and upwards
        z    # the thing to slice (input)
        xz\@ # the index first occurrence of \@ in z
      \)     # string to count occurrences of (\x is shorthand for "x")
    0        # value when ternary condition is false
  "@) "      # the string to be repeated (automatically terminated by end-of-line)
```
[Answer]
# [krrp](https://github.com/jfrech/krrp), 63 bytes
```
^":\L,^*':?#?E'E!-@1#!r'?=#!f'$64.-?*L$64.L$41.L$32.-@0#!r'.0".
```
[Try it online!](https://tio.run/##yy4qKvivaPc/TskqxkcnTkvdyl7Z3lXdVVHXwVBZsUjd3lZZMU1dxcxET9deywdE@6iYGAIJYyM9XQcDkBI9AyW9/zE@CooOIGkFRU2QAi4uOwUfBx9NGHRF46OJOaCKgGk4HyrqAFbngK4WjjXh6hA8qNmu///lF5Rk5ucV/9fVLS4pAgA "krrp – Try It Online")
---
# Explanation
```
^":                   ~ take the string as a parameter named `"`
 \L                   ~ import the list module
 ,^*':                ~ apply a binary function
  ?#?E'               ~  if the string is empty,
   E                  ~   return the empty string; else
   !-@1#!r'           ~   define `-` as the cut Gimbap
   ?=#!f'$64.         ~    if an at sign is seen,
    -                 ~    return the cut Gimbap; else
    ?*                ~    if an at sign has been seen,
     L$64.L$41.L$32.- ~     return a Gimbap piece together
                      ~     with freshly cut Gimbap; else
     @0#!r'           ~     proceed to cut
 .0".                 ~ to zero and the above taken string
```
[Try it online!](https://tio.run/##fVLBjtowFLznKyawEmK1QbvtqoddFXJBveQTqlUc8kKsJbZlm7b00E9vaptAgLXqKLH8MuMZP8@71qpPl4iMP6ip4YJQLktYiYpgW8KOdVXNQL@UJmO4FP3b5CVKt@z9SDFWc7EFM2BQTLOOLGkIN9coJ2WC70V0A94pqe1RlRuLTtb7HSV4eLufvXyEM6V2BydRccH0Ac1ebKzzlwCr6Wo9@4AHby7tcQPqlD08OALWMT@AJrvXIrACduC@gnaGPC/N8qdpqmc3vFMns9J3wdM3e4tvvKuY8rTV12nazO6@PC@uaN4hE2AWhm@Fd2iIRDCILGrw0uEoMfrD6j5KuxZqncnKKV3IofDuirvnJ/f5/GmRHXknPTYoQXHauFuXW3IWdALEo@XHT25bNC5Frbu2qFnkj5FmAkrLDbnwuFQ6XoLF42QRC6DEb9LSnawODWGV/EEhlmK4uN4lL81D39O5P9v/o/cK07py6zY0SbJEkRfz07MeZcnYm58BMNby60qYz@uhmgdcfos9v/MzblwNe6/7v1L56Js@y9xB/wE "krrp – Try It Online")
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 42 bytes
```
''+($args|sls '(?<=@.*)\)'-a|% m*|%{'@)'})
```
[Try it online!](https://tio.run/##hY5bDsIgEEX/WcXEUGFq6wKMjSzExDRK1QS1ljaalK4d6UNF0@jAB8w5cyG/3GShD1IpS7OktozNOE2LvTZaaWB8tUzEPMQ1sjg1AZxCE9RMIGvQNoQITsBVxF2rLRaBO4G3GX4aY86IKf6G9fTd6X3P@LoKFGIk1Y9s1w8ufOo/7H0GwUAAdcfo8ZxXZQRU3nO5LeUOEqCbHhVSV6p0jSnNBrEDE8oHFsvraxAXz4kJaewD "PowerShell – Try It Online")
Unrolled:
```
$arrayOfCuttedGimbaps = $args|select-string '(?<=@.*)\)' -AllMatches|% Matches|%{'@)'}
''+($arrayOfCuttedGimbaps)    # toString and output
```
]