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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: D = None
        self.r: D = None
        self.v: E = None
        self.txt = txt

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

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

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

m = A("m")
l = B("l")
f = C("f")
c = D("c")
i = E("i")
j = D("j")
n = D("n")

m.y = l
m.o = l
m.r = n
m.q = j
m.x = i
l.o = f
l.q = j
l.r = c
l.v = i
f.v = i
f.t = m
c.o = i
c.u = i
i.z = m
i.x = f
i.q = f
i.u = c
j.o = i
j.u = i
n.o = i
n.u = i
assert i.u.o.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: B = None
        self.r: D = None
        self.q: D = None
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: D = None
        self.r: D = None
        self.v: E = None
        self.txt = txt

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

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

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

m = A("m")
l = B("l")
f = C("f")
c = D("c")
i = E("i")
j = D("j")
n = D("n")

m.y = l
m.o = l
m.r = n
m.q = j
m.x = i
l.o = f
l.q = j
l.r = c
l.v = i
f.v = i
f.t = m
c.o = i
c.u = i
i.z = m
i.x = f
i.q = f
i.u = c
j.o = i
j.u = i
n.o = i
n.u = i
assert i.u.o.u.u.txt == "i"