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

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

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

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

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

f = A("f")
l = B("l")
k = C("k")
j = D("j")
i = E("i")
h = D("h")
e = A("e")
c = A("c")
d = A("d")
m = C("m")

f.z = m
l.o = i
k.o = m
k.y = l
k.s = h
k.z = j
k.w = i
j.t = l
j.y = f
j.w = i
j.o = c
j.z = d
i.q = j
i.x = j
i.y = l
i.o = l
h.t = l
h.y = c
h.o = c
h.z = c
h.w = i
e.z = k
c.z = m
d.z = k
m.o = k
m.y = l
m.s = h
m.z = h
m.w = i
assert k.o.o.o.s.t.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

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

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

f = A("f")
l = B("l")
k = C("k")
j = D("j")
i = E("i")
h = D("h")
e = A("e")
c = A("c")
d = A("d")
m = C("m")

f.z = m
l.o = i
k.o = m
k.y = l
k.s = h
k.z = j
k.w = i
j.t = l
j.y = f
j.w = i
j.o = c
j.z = d
i.q = j
i.x = j
i.y = l
i.o = l
h.t = l
h.y = c
h.o = c
h.z = c
h.w = i
e.z = k
c.z = m
d.z = k
m.o = k
m.y = l
m.s = h
m.z = h
m.w = i
assert k.o.o.o.s.t.o.y.txt == "l"