public static void main(String[] args) {

		// read names from file
		List<String> names = new ArrayList<String>();
		BufferedReader reader = null;
		try {
			reader = new BufferedReader(new FileReader("/home/nagasaki45/code/cattle_drive/names.txt"));
			String line;
			while((line = reader.readLine()) != null) {
				names.add(line);
			}
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if (reader != null) {
					reader.close();
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
		}

		// sort and print the names
		Collections.sort(names);
		Iterator<String> iter = names.iterator();
		while(iter.hasNext()) {
			System.out.println(iter.next());
		}
	}