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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: A = None
        self.p: B = None
        self.r: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: A = None
        self.p: B = None
        self.r: E = None
        self.txt = txt

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

m.t = c
m.y = f
m.p = j
j.o = f
j.w = f
j.q = m
j.p = b
j.z = a
b.s = g
e.y = a
e.q = b
e.x = b
e.p = c
c.z = b
c.y = m
c.p = g
c.r = f
g.o = f
g.q = m
g.w = c
g.p = b
g.z = e
a.y = e
a.q = b
a.x = b
a.p = f
f.z = b
f.y = m
f.p = g
f.r = c
assert m.y.y.p.o.z.s.txt == "g"