Remove duplicated paths
Use print instead of write

Because we use puts.