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

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

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

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

i = A("i")
j = B("j")
g = C("g")
e = D("e")
f = C("f")
b = B("b")
h = A("h")
c = C("c")
m = A("m")

i.t = g
i.s = b
j.v = b
g.p = c
g.u = j
g.w = e
e.x = f
e.z = j
f.p = c
f.u = b
f.w = e
b.v = j
h.t = g
h.s = j
c.p = f
c.u = j
c.w = e
m.t = c
m.s = b
assert m.t.p.u.v.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: B = None
        self.txt = txt

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

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

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

i = A("i")
j = B("j")
g = C("g")
e = D("e")
f = C("f")
b = B("b")
h = A("h")
c = C("c")
m = A("m")

i.t = g
i.s = b
j.v = b
g.p = c
g.u = j
g.w = e
e.x = f
e.z = j
f.p = c
f.u = b
f.w = e
b.v = j
h.t = g
h.s = j
c.p = f
c.u = j
c.w = e
m.t = c
m.s = b
assert m.t.p.u.v.v.v.v.txt == "b"