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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: E = None
        self.t: E = None
        self.w: A = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: E = None
        self.t: E = None
        self.w: A = None
        self.u: A = None
        self.txt = txt

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

k.o = n
h.u = k
h.r = k
h.y = k
h.x = f
m.z = f
m.u = i
j.t = l
j.s = m
i.q = h
i.y = n
i.t = n
i.w = k
i.u = k
d.z = m
d.u = i
f.z = l
f.u = i
l.z = f
l.u = n
b.t = d
b.s = f
n.q = h
n.y = i
n.t = i
n.w = k
n.u = k
assert l.z.u.y.t.txt == "i"