public String fixTheSpell(String spell) {
		char[] charArray = spell.toCharArray();
		LinkedList<Character> characters = new LinkedList<Character>();
		for (int i = 0; i < charArray.length; i++) {
			if (spell.charAt(i) == 'A' || spell.charAt(i) == 'Z') {
				characters.add(charArray[i]);
			}
		}
		for (int i = 0; i < charArray.length; i++) {
			if (charArray[i] == 'A' || charArray[i] == 'Z') {
				charArray[i] = characters.removeLast();
			}
		}

		return new String(charArray);
	}