#!/usr/bin/env python
# -*- coding: utf-8 -*-

class Memoize:
    def __init__(self, fn):
        self.fn = fn
        self.memo = {}

    def __call__(self, *args):
        if args not in self.memo:
	           self.memo[args] = self.fn(*args)
        return self.memo[args]
