class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: A = None
        self.r: D = None
        self.t: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

b = A("b")
i = B("i")
f = C("f")
m = D("m")
l = E("l")
e = F("e")
d = B("d")

b.y = f
b.q = l
i.x = m
i.r = m
i.w = b
i.t = d
f.v = b
f.p = l
m.y = b
l.t = d
e.o = f
d.x = m
d.r = m
d.w = b
d.t = i
assert m.y.y.v.y.p.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: A = None
        self.r: D = None
        self.t: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

b = A("b")
i = B("i")
f = C("f")
m = D("m")
l = E("l")
e = F("e")
d = B("d")

b.y = f
b.q = l
i.x = m
i.r = m
i.w = b
i.t = d
f.v = b
f.p = l
m.y = b
l.t = d
e.o = f
d.x = m
d.r = m
d.w = b
d.t = i
assert m.y.y.v.y.p.t.t.txt == "i"