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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: C = None
        self.v: C = None
        self.u: E = None
        self.txt = txt

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

b = A("b")
d = B("d")
j = C("j")
i = D("i")
h = E("h")

b.s = d
b.q = d
b.t = d
b.v = j
d.x = b
j.o = i
j.u = b
i.y = j
i.z = j
i.v = j
i.u = h
h.u = i
h.o = d
h.t = j
assert h.o.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: B = None
        self.v: C = None
        self.t: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: C = None
        self.v: C = None
        self.u: E = None
        self.txt = txt

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

b = A("b")
d = B("d")
j = C("j")
i = D("i")
h = E("h")

b.s = d
b.q = d
b.t = d
b.v = j
d.x = b
j.o = i
j.u = b
i.y = j
i.z = j
i.v = j
i.u = h
h.u = i
h.o = d
h.t = j
assert h.o.x.q.txt == "d"