The fundamental groups of one-dimensional spaces