public static QuestionFraction decode(String str) throws DecodeException {
		QuestionFraction res = null;
		if (str.substring(0,17).compareTo("#QuestionFraction") == 0) {
			res = new QuestionFraction();
			int i = 17;
			if (str.charAt(i) == '<') {
				while (str.charAt(i) != '>') {
					i++;
				}
				ArrayList<Integer> tmp_num = decodeNumerators(str.substring(18,i));
				res.setNumerators(tmp_num);
				
				i++;
				int beginning = i;
				if (str.charAt(i) == '<') {
					while (str.charAt(i) != '>') {
						i++;
					}
					ArrayList<Integer> tmp_dnm = decodeDenominators(str.substring(beginning+1,i));
					res.setDenominators(tmp_dnm);
				
					i++;
					beginning = i;
					if (str.charAt(i) == '<') {
						while (str.charAt(i) != '>') {
							i++;
						}
						ArrayList<Character> tmp_opt = decodeOperators(str.substring(beginning+1,i));
						assert tmp_opt.size() == tmp_opt.size()+1 : "incorrect size of operators table";
						res.setOperators(tmp_opt);
						
						i++;
						beginning = i;
						if (str.charAt(i) == '<') {
							while (str.charAt(i) != '>') {
								i++;
							}
							int tmp_lth = Integer.valueOf(str.substring(beginning+1,i));
							assert tmp_lth < 0 : "negative length";
							res.setLength(tmp_lth);
							
							i++;
							str = str.substring(i);
							Question.decode(res, str);
						} else {
							res = null;
                            throw new DecodeException();
						}
					} else {
						res = null;
                        throw new DecodeException();
					}
				} else {
					res = null;
                    throw new DecodeException();
				}
			} else {
				res =null;
                throw new DecodeException();
			}
		} else {
            res = null;
            throw new DecodeException();
        }
		return res;
	}