def neighbors(s):
    for (i, c) in enumerate(s):
        if (c != B[i]):
            break
    t = list(s)
    for j in xrange((i + 1), len(s)):
        if (t[j] == B[i]):
            (t[i], t[j]) = (t[j], t[i])
            (yield ''.join(t))
            (t[j], t[i]) = (t[i], t[j])
def neighbors(s):
    for (i, c) in enumerate(s):
        if (c != B[i]):
            break
    t = list(s)
    for j in xrange((i + 1), len(s)):
        if (t[j] == B[i]):
            (t[i], t[j]) = (t[j], t[i])
            (yield .join(t))
            (t[j], t[i]) = (t[i], t[j])