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

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

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

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

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

a = A("a")
b = B("b")
f = C("f")
m = D("m")
k = E("k")
e = A("e")
l = A("l")

a.u = k
a.z = k
a.o = b
a.r = b
b.r = k
f.w = k
f.o = k
f.t = a
m.t = k
m.r = k
m.u = f
m.y = b
m.z = e
k.w = f
k.x = f
k.z = l
k.o = e
e.u = k
e.z = k
e.o = b
e.r = b
l.u = k
l.z = k
l.o = b
l.r = b
assert m.u.t.o.r.o.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: E = None
        self.o: B = None
        self.r: B = None
        self.txt = txt

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

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

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

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

a = A("a")
b = B("b")
f = C("f")
m = D("m")
k = E("k")
e = A("e")
l = A("l")

a.u = k
a.z = k
a.o = b
a.r = b
b.r = k
f.w = k
f.o = k
f.t = a
m.t = k
m.r = k
m.u = f
m.y = b
m.z = e
k.w = f
k.x = f
k.z = l
k.o = e
e.u = k
e.z = k
e.o = b
e.r = b
l.u = k
l.z = k
l.o = b
l.r = b
assert m.u.t.o.r.o.o.r.txt == "k"