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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: E = None
        self.q: E = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: B = None
        self.s: B = None
        self.u: B = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: A = None
        self.r: E = None
        self.txt = txt

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

j = A("j")
l = B("l")
e = C("e")
i = D("i")
h = E("h")

j.t = e
l.w = h
l.r = h
l.q = h
l.z = e
e.w = i
e.q = l
e.s = l
e.u = l
e.v = l
i.u = j
i.p = j
i.r = h
h.p = j
assert h.p.t.q.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: E = None
        self.q: E = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: B = None
        self.s: B = None
        self.u: B = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: A = None
        self.r: E = None
        self.txt = txt

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

j = A("j")
l = B("l")
e = C("e")
i = D("i")
h = E("h")

j.t = e
l.w = h
l.r = h
l.q = h
l.z = e
e.w = i
e.q = l
e.s = l
e.u = l
e.v = l
i.u = j
i.p = j
i.r = h
h.p = j
assert h.p.t.q.z.q.txt == "l"