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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: C = None
        self.u: B = None
        self.r: E = None
        self.t: E = None
        self.txt = txt

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

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

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

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

b.z = g
b.y = h
i.z = j
i.r = j
i.t = j
i.y = m
i.u = h
m.z = n
g.s = i
g.w = i
g.p = n
n.r = i
h.z = j
h.r = j
h.y = m
h.u = i
h.t = n
j.r = h
assert g.w.u.z.r.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: C = None
        self.u: B = None
        self.r: E = None
        self.t: E = None
        self.txt = txt

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

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

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

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

b.z = g
b.y = h
i.z = j
i.r = j
i.t = j
i.y = m
i.u = h
m.z = n
g.s = i
g.w = i
g.p = n
n.r = i
h.z = j
h.r = j
h.y = m
h.u = i
h.t = n
j.r = h
assert g.w.u.z.r.txt == "h"