james|chicago - first run alradeyd james exists - second run since input valeue is james and its akready exit charles|chicago - third time run charles is not exists so written to the file