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

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

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

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

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

a = A("a")
m = B("m")
g = C("g")
j = D("j")
d = E("d")
c = D("c")
e = C("e")

a.r = m
m.x = d
m.u = d
m.o = g
g.w = d
g.t = d
g.q = a
g.o = j
j.p = m
j.t = g
j.z = c
d.p = c
d.u = g
d.x = g
d.t = m
d.w = e
c.p = m
c.t = g
c.z = j
e.w = d
e.t = d
e.q = a
e.o = c
assert g.w.w.q.r.o.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

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

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

a = A("a")
m = B("m")
g = C("g")
j = D("j")
d = E("d")
c = D("c")
e = C("e")

a.r = m
m.x = d
m.u = d
m.o = g
g.w = d
g.t = d
g.q = a
g.o = j
j.p = m
j.t = g
j.z = c
d.p = c
d.u = g
d.x = g
d.t = m
d.w = e
c.p = m
c.t = g
c.z = j
e.w = d
e.t = d
e.q = a
e.o = c
assert g.w.w.q.r.o.w.t.txt == "m"