class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: B = None
        self.r: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: G = None
        self.y: C = None
        self.r: H = None
        self.z: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: G = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: A = None
        self.u: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: D = None
        self.s: E = None
        self.txt = txt

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

g.s = h
g.u = a
g.r = c
a.r = c
a.x = e
e.u = f
e.w = m
e.z = m
e.y = d
e.r = c
i.z = l
l.u = i
h.r = g
h.z = m
h.y = a
m.z = c
m.r = g
m.u = g
c.o = h
c.z = f
c.s = l
d.u = i
d.w = m
d.z = m
d.y = e
d.r = c
f.z = l
assert h.r.s.y.r.o.z.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: B = None
        self.r: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: G = None
        self.y: C = None
        self.r: H = None
        self.z: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: G = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: A = None
        self.u: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: D = None
        self.s: E = None
        self.txt = txt

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

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