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

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

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

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

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

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

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

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

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

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

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

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

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