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

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

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

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

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

k = A("k")
b = B("b")
n = C("n")
m = D("m")
a = E("a")
l = A("l")
h = C("h")
d = A("d")
c = D("c")

k.z = c
k.x = h
k.o = n
k.t = d
b.y = n
n.v = l
n.z = a
n.r = m
m.w = c
m.z = c
m.p = n
m.q = d
a.y = c
l.z = c
l.x = h
l.o = n
l.t = k
h.v = d
h.z = a
h.r = c
d.z = m
d.x = n
d.o = h
d.t = l
c.w = m
c.z = m
c.p = n
c.q = k
assert b.y.v.o.r.w.w.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: C = None
        self.o: C = None
        self.t: A = None
        self.txt = txt

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

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

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

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

k = A("k")
b = B("b")
n = C("n")
m = D("m")
a = E("a")
l = A("l")
h = C("h")
d = A("d")
c = D("c")

k.z = c
k.x = h
k.o = n
k.t = d
b.y = n
n.v = l
n.z = a
n.r = m
m.w = c
m.z = c
m.p = n
m.q = d
a.y = c
l.z = c
l.x = h
l.o = n
l.t = k
h.v = d
h.z = a
h.r = c
d.z = m
d.x = n
d.o = h
d.t = l
c.w = m
c.z = m
c.p = n
c.q = k
assert b.y.v.o.r.w.w.p.txt == "n"