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

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

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

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

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

g = A("g")
i = B("i")
l = C("l")
f = D("f")
e = E("e")

g.s = e
g.u = e
i.z = f
l.v = f
l.q = f
l.y = f
f.v = l
e.p = i
assert g.s.p.z.v.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: E = None
        self.txt = txt

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

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

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

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

g = A("g")
i = B("i")
l = C("l")
f = D("f")
e = E("e")

g.s = e
g.u = e
i.z = f
l.v = f
l.q = f
l.y = f
f.v = l
e.p = i
assert g.s.p.z.v.y.txt == "f"