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

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

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

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

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

n = A("n")
i = B("i")
k = C("k")
h = D("h")
c = E("c")
b = B("b")
j = D("j")
m = C("m")

n.t = j
i.w = m
k.w = c
h.p = c
h.y = b
h.u = b
h.z = i
c.q = h
c.y = h
c.v = i
c.u = m
c.w = m
b.w = k
j.p = c
j.y = b
j.u = i
j.z = i
m.w = c
assert j.p.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

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

n = A("n")
i = B("i")
k = C("k")
h = D("h")
c = E("c")
b = B("b")
j = D("j")
m = C("m")

n.t = j
i.w = m
k.w = c
h.p = c
h.y = b
h.u = b
h.z = i
c.q = h
c.y = h
c.v = i
c.u = m
c.w = m
b.w = k
j.p = c
j.y = b
j.u = i
j.z = i
m.w = c
assert j.p.q.z.txt == "i"