#!/usr/bin/python

import sys

class Highlighter:

    arguments = []
    COLORS = {
        'red'           : '\033[0;31m%s\033[00m',
        'green'         : '\033[0;32m%s\033[00m',
        'yellow'        : '\033[0;33m%s\033[00m',
        'red_bold'      : '\033[1;31m%s\033[00m',
        'green_bold'    : '\033[1;32m%s\033[00m',
        'yellow_bold'   : '\033[1;33m%s\033[00m',
    }

    def __init__(self):
        self.arguments = sys.argv
        self.arguments.pop(0)
        self.parse()

    def highlight(self, line):
        for i in range(0, len(self.arguments)):
            needle = self.arguments[i]
            c = i
            while c>len(self.COLORS)-1:
                c -= len(self.COLORS)
            color = self.COLORS.values()[c]
            line = line.replace(needle, color % needle)
        return line

    def parse(self):
        while True:
            line = sys.stdin.readline()
            if line:
                sys.stdout.write(self.highlight(line))
            else:
                break

if __name__=='__main__':
    Highlighter()
