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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: B = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: B = None
        self.x: D = None
        self.txt = txt

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

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

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

h.w = a
h.z = c
h.y = b
h.o = d
n.t = c
a.y = e
a.w = n
a.x = f
e.u = f
e.o = f
e.s = b
e.r = a
b.u = a
b.r = a
f.u = e
f.o = e
f.s = b
f.r = a
c.t = n
g.w = a
g.z = n
g.y = m
g.o = h
d.w = a
d.z = c
d.y = m
d.o = g
m.u = a
m.r = a
assert a.y.s.u.txt == "a"