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

class B:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: D = None
        self.p: 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.z: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: D = None
        self.p: 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.z: B = None
        self.txt = txt

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

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

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