public String reverseWords(String s) {
		s = s.trim();
		System.out.println(s);
		if (s.length() == 0)
			return "";
		String result = "";
		for (int i = s.length() - 1; i >= 0;) {
			String temp = "";
			int end = i + 1;
			while (i >= 0 && s.charAt(i) != ' ') {
				i--;
			}
			temp = s.substring(i + 1, end);
			while (i >= 0 && s.charAt(i) == ' ') {
				i--;
			}
			result += temp;
			result += " ";
		}
		return result.substring(0, result.length() - 1);
	}