class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: C = None
        self.t: D = None
        self.s: F = None
        self.q: F = None
        self.u: C = None
        self.x: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: C = None
        self.u: F = None
        self.txt = txt

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

c.z = h
c.y = h
c.u = h
c.t = e
c.s = m
c.q = m
c.x = m
n.x = c
h.o = a
h.v = l
e.v = n
e.r = c
e.q = a
a.y = m
m.q = g
m.x = e
g.p = h
l.x = g
l.z = h
l.u = m
f.z = h
f.y = h
f.u = h
f.t = e
f.s = m
f.q = m
f.x = m
assert f.t.v.x.s.x.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: C = None
        self.t: D = None
        self.s: F = None
        self.q: F = None
        self.u: C = None
        self.x: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: C = None
        self.u: F = None
        self.txt = txt

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

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