#!/usr/local/bin/python
#coding=utf-8

import re

def contains_roman_literals(line):
	if re.search(r'[IXVLCDM]$', line) != None:	
		return True

	return False

def is_question(line):
	if re.search(r'\?$', line) != None:
		return True

	return False

def read_input(file_name):
	"""
	"""
	resource_lines = []
	question_lines = []
	roman_attributes = []
	
	input_content = {'roman_attributes': roman_attributes, \
					 'resource_lines': resource_lines, 'question_lines': question_lines}

	with open(file_name, "r") as text_file:
		for line in text_file:
			line = line.strip()

			if is_question(line):
				question_lines.append(line)
			elif contains_roman_literals(line): 
				roman_attributes.append(line)
			else:
				resource_lines.append(line)

	return input_content

if __name__ == "__main__":
    read_input("input.txt")