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

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: B = None
        self.z: C = None
        self.txt = txt

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

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

j.u = g
j.p = g
j.o = n
j.t = k
j.z = d
k.p = j
d.o = j
d.w = g
d.q = g
d.s = m
d.r = k
g.q = j
g.w = k
g.z = n
m.u = k
m.t = j
n.o = j
n.w = g
n.q = g
n.s = m
n.r = k
assert j.o.r.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: C = None
        self.p: D = None
        self.t: B = None
        self.z: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: B = None
        self.z: C = None
        self.txt = txt

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

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

j.u = g
j.p = g
j.o = n
j.t = k
j.z = d
k.p = j
d.o = j
d.w = g
d.q = g
d.s = m
d.r = k
g.q = j
g.w = k
g.z = n
m.u = k
m.t = j
n.o = j
n.w = g
n.q = g
n.s = m
n.r = k
assert j.o.r.p.t.txt == "k"