let decompress s =
  let rec loop t = function
    i when i == String.length s -> t
  | i ->
     if s.[i] == '@' then
       let len = String.sub s (i+1) 1 |> int_of_string in
       loop (t^(String.make len s.[i+2])) (i+2)
     else
       loop (t^(String.make 1 s.[i])) (i+1)
  in loop "" 0
;;

let () =
  let rec read () =
    try let line = read_line () in
        Printf.printf "%s\n" (decompress line);
        read ()
    with End_of_file -> ()
  in read ()
;;