class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: C = None
        self.r: D = None
        self.w: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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

b.z = i
b.y = n
b.r = c
b.w = e
j.t = n
j.s = i
j.y = d
n.s = e
c.y = k
m.w = e
m.s = k
m.z = n
d.t = n
d.s = m
d.y = j
e.y = k
i.w = c
i.s = b
i.z = n
k.z = i
k.y = n
k.r = e
k.w = c
assert b.z.s.r.y.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: C = None
        self.r: D = None
        self.w: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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

b.z = i
b.y = n
b.r = c
b.w = e
j.t = n
j.s = i
j.y = d
n.s = e
c.y = k
m.w = e
m.s = k
m.z = n
d.t = n
d.s = m
d.y = j
e.y = k
i.w = c
i.s = b
i.z = n
k.z = i
k.y = n
k.r = e
k.w = c
assert b.z.s.r.y.r.y.txt == "k"