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

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

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

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

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

e = A("e")
g = B("g")
m = C("m")
k = D("k")
i = E("i")
j = B("j")
a = D("a")
f = E("f")
l = B("l")

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

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

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

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

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

e = A("e")
g = B("g")
m = C("m")
k = D("k")
i = E("i")
j = B("j")
a = D("a")
f = E("f")
l = B("l")

e.q = a
e.r = a
e.p = i
e.x = g
e.z = k
g.t = e
m.o = a
m.s = e
k.p = m
k.x = a
k.t = f
i.y = f
i.q = f
i.x = m
j.t = e
a.p = m
a.x = k
a.t = i
f.y = i
f.q = i
f.x = m
l.t = e
assert a.p.o.t.x.txt == "m"