class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: E = None
        self.x: B = None
        self.z: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: A = None
        self.txt = txt

b = A("b")
d = B("d")
g = C("g")
k = D("k")
e = E("e")

b.v = k
b.z = k
b.t = e
b.x = d
d.t = k
d.x = g
g.o = d
g.u = k
k.u = d
k.s = e
e.z = d
e.u = b
assert d.t.u.t.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: E = None
        self.x: B = None
        self.z: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: A = None
        self.txt = txt

b = A("b")
d = B("d")
g = C("g")
k = D("k")
e = E("e")

b.v = k
b.z = k
b.t = e
b.x = d
d.t = k
d.x = g
g.o = d
g.u = k
k.u = d
k.s = e
e.z = d
e.u = b
assert d.t.u.t.s.u.txt == "b"