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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: A = None
        self.r: D = None
        self.u: E = None
        self.w: A = None
        self.txt = txt

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

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

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

d = A("d")
f = B("f")
a = C("a")
k = D("k")
m = E("m")
c = D("c")
j = B("j")

d.p = k
d.u = a
d.t = a
d.z = a
f.z = d
f.s = d
f.w = d
f.r = c
f.u = m
a.s = k
a.q = m
k.t = m
k.w = m
k.y = a
k.q = d
k.o = c
m.t = a
m.x = a
m.r = a
c.t = m
c.w = m
c.y = a
c.q = d
c.o = k
j.z = d
j.s = d
j.w = d
j.r = k
j.u = m
assert k.o.q.z.q.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: C = None
        self.t: C = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: A = None
        self.r: D = None
        self.u: E = None
        self.w: A = None
        self.txt = txt

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

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

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

d = A("d")
f = B("f")
a = C("a")
k = D("k")
m = E("m")
c = D("c")
j = B("j")

d.p = k
d.u = a
d.t = a
d.z = a
f.z = d
f.s = d
f.w = d
f.r = c
f.u = m
a.s = k
a.q = m
k.t = m
k.w = m
k.y = a
k.q = d
k.o = c
m.t = a
m.x = a
m.r = a
c.t = m
c.w = m
c.y = a
c.q = d
c.o = k
j.z = d
j.s = d
j.w = d
j.r = k
j.u = m
assert k.o.q.z.q.x.q.txt == "m"