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

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

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

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

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

b = A("b")
m = B("m")
k = C("k")
j = D("j")
i = E("i")
n = E("n")
g = B("g")
a = D("a")
d = E("d")

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

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

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

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

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

b = A("b")
m = B("m")
k = C("k")
j = D("j")
i = E("i")
n = E("n")
g = B("g")
a = D("a")
d = E("d")

b.r = a
b.o = j
m.t = d
m.o = j
m.p = b
m.r = n
m.u = k
k.u = a
j.z = i
j.o = a
i.y = k
i.x = d
i.q = j
n.y = k
n.x = i
n.q = j
g.t = i
g.o = a
g.p = b
g.r = d
g.u = k
a.z = d
a.o = j
d.y = k
d.x = n
d.q = j
assert d.x.x.y.u.z.q.z.q.z.txt == "i"