def restore(s, t):
t = (c for c in t)<EOL>return '<STR_LIT>'.join(next(t) if not is_blacksquare(c) else c for c in s)<EOL>
s is the source string, it can contain '.'
t is the target, it's smaller than s by the number of '.'s in s

Each char in s is replaced by the corresponding
char in t, jumping over '.'s in s.

>>> restore('ABC.DEF', 'XYZABC')
'XYZ.ABC'