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

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

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

class D:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: A = None
        self.s: A = None
        self.t: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: A = None
        self.s: A = None
        self.t: A = None
        self.txt = txt

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

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