let (inp, out) = (Scanf.Scanning.from_file "important.in", open_out "important.out");;

let rec answer conj n = 
  if n > 0 then (
    let s = Scanf.bscanf inp " %[A-Z]%[^A-Z]" (fun a b -> a) in
    Printf.fprintf out "%s(%s<=>%s)" conj s s; answer "&" (n-1)
  );;

Scanf.bscanf inp "%d\n" (answer "Yes\n");;
close_out out;;
