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

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

class C:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: C = None
        self.u: C = None
        self.t: D = None
        self.txt = txt

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

e = A("e")
g = B("g")
d = C("d")
b = D("b")
c = C("c")
h = D("h")

e.t = b
e.p = b
e.r = b
g.t = b
d.y = c
d.w = c
d.u = c
d.t = h
b.r = h
b.s = g
b.z = g
b.u = g
c.y = d
c.w = d
c.u = d
c.t = h
h.r = b
h.s = g
h.z = g
h.u = g
assert h.r.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: D = None
        self.r: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: C = None
        self.u: C = None
        self.t: D = None
        self.txt = txt

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

e = A("e")
g = B("g")
d = C("d")
b = D("b")
c = C("c")
h = D("h")

e.t = b
e.p = b
e.r = b
g.t = b
d.y = c
d.w = c
d.u = c
d.t = h
b.r = h
b.s = g
b.z = g
b.u = g
c.y = d
c.w = d
c.u = d
c.t = h
h.r = b
h.s = g
h.z = g
h.u = g
assert h.r.s.t.txt == "b"