let print_array oc string_of_ele a =
  Array.iter (fun ele -> Printf.fprintf oc "%s\n" (string_of_ele ele)) a