#!/bin/python
from functools import reduce
import sys

def adder(the_dict):
	def concat(x,y):
		nonlocal the_dict
		if x and y:
			return the_dict[x] + the_dict[y]
		elif x:
			return the_dict[x]
		else:
			return the_dict[y]
	return reduce(concat,the_dict)

d={'a':'fuck ','b':'this ','c':'pluses '}
print('d is\n',d)
print(adder(d))
