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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: D = None
        self.r: D = None
        self.o: D = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: D = None
        self.r: D = None
        self.o: D = None
        self.q: A = None
        self.txt = txt

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

k.o = h
k.v = f
j.v = m
e.p = j
e.z = d
e.y = i
e.u = h
l.v = e
l.w = m
l.r = k
l.t = a
m.u = h
m.s = h
m.r = l
m.o = l
m.q = k
h.v = e
h.w = f
h.r = a
h.t = a
f.u = h
f.s = l
f.r = l
f.o = l
f.q = a
a.o = l
a.v = f
i.v = m
d.p = i
d.y = i
d.z = e
d.u = l
assert a.o.t.o.r.txt == "k"