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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: E = None
        self.s: E = None
        self.w: A = None
        self.p: E = None
        self.txt = txt

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

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

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

j = A("j")
l = B("l")
e = C("e")
a = D("a")
f = E("f")
c = E("c")
h = E("h")

j.s = f
l.q = j
l.w = j
l.t = c
l.p = c
l.s = f
e.z = a
a.u = l
f.q = j
c.q = j
h.q = j
assert e.z.u.q.s.q.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: E = None
        self.s: E = None
        self.w: A = None
        self.p: E = None
        self.txt = txt

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

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

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

j = A("j")
l = B("l")
e = C("e")
a = D("a")
f = E("f")
c = E("c")
h = E("h")

j.s = f
l.q = j
l.w = j
l.t = c
l.p = c
l.s = f
e.z = a
a.u = l
f.q = j
c.q = j
h.q = j
assert e.z.u.q.s.q.s.q.txt == "j"