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

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

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

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

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

f = A("f")
h = B("h")
a = C("a")
g = D("g")
l = E("l")
i = A("i")
e = E("e")
c = D("c")
m = C("m")

f.u = e
f.t = e
h.v = e
a.u = l
a.z = l
a.t = m
a.r = m
a.x = i
g.z = l
g.y = h
g.r = a
l.x = c
l.y = m
l.s = e
i.u = e
i.t = l
e.x = g
e.y = m
e.s = l
c.z = e
c.y = h
c.r = a
m.u = l
m.z = l
m.t = a
m.r = a
m.x = i
assert m.t.t.r.r.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: E = None
        self.txt = txt

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

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

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

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

f = A("f")
h = B("h")
a = C("a")
g = D("g")
l = E("l")
i = A("i")
e = E("e")
c = D("c")
m = C("m")

f.u = e
f.t = e
h.v = e
a.u = l
a.z = l
a.t = m
a.r = m
a.x = i
g.z = l
g.y = h
g.r = a
l.x = c
l.y = m
l.s = e
i.u = e
i.t = l
e.x = g
e.y = m
e.s = l
c.z = e
c.y = h
c.r = a
m.u = l
m.z = l
m.t = a
m.r = a
m.x = i
assert m.t.t.r.r.z.s.txt == "e"