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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: B = None
        self.z: D = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: B = None
        self.z: D = None
        self.txt = txt

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

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

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

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

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