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

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

g = A("g")
c = B("c")
h = C("h")
k = D("k")
f = E("f")
j = C("j")
m = C("m")
e = A("e")

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

g = A("g")
c = B("c")
h = C("h")
k = D("k")
f = E("f")
j = C("j")
m = C("m")
e = A("e")

g.s = c
g.r = f
g.z = j
c.o = k
c.x = e
c.y = m
h.u = k
h.t = f
h.z = g
k.y = e
f.s = e
j.u = k
j.t = f
j.z = e
m.u = k
m.t = f
m.z = g
e.s = c
e.r = f
e.z = j
assert f.s.z.z.r.s.z.t.s.txt == "e"