def run(fun, args, input, output): sys.stdin = input sys.stdout = output fun(args) sys.stdin = sys.__stdin__ sys.stdout = sys.__stdout__