class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: D = None
        self.r: E = None
        self.s: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: E = None
        self.y: C = None
        self.r: C = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: A = None
        self.v: C = None
        self.t: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: E = None
        self.y: C = None
        self.r: C = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: A = None
        self.v: C = None
        self.t: B = None
        self.txt = txt

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

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

j.u = b
j.y = m
j.r = h
j.s = c
c.u = e
e.s = j
e.t = j
e.v = h
e.y = b
e.r = b
m.w = i
m.z = j
m.v = e
m.t = c
i.p = m
h.p = m
b.s = j
b.t = j
b.v = h
b.y = e
b.r = e
assert j.y.z.y.z.u.r.txt == "e"