class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: B = None
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: D = None
        self.r: A = None
        self.o: B = None
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: C = None
        self.txt = txt

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

e = A("e")
c = B("c")
b = C("b")
f = D("f")
n = E("n")

e.t = b
e.q = b
e.v = c
c.t = e
b.y = e
b.r = e
b.z = f
b.t = f
b.o = c
f.u = e
f.w = b
n.o = c
assert e.v.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: B = None
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: D = None
        self.r: A = None
        self.o: B = None
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: C = None
        self.txt = txt

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

e = A("e")
c = B("c")
b = C("b")
f = D("f")
n = E("n")

e.t = b
e.q = b
e.v = c
c.t = e
b.y = e
b.r = e
b.z = f
b.t = f
b.o = c
f.u = e
f.w = b
n.o = c
assert e.v.t.q.txt == "b"