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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: E = None
        self.o: B = None
        self.s: A = None
        self.y: G = None
        self.u: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: G = None
        self.w: C = None
        self.y: G = None
        self.x: C = None
        self.r: G = None
        self.q: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: E = None
        self.u: B = None
        self.x: B = None
        self.w: H = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: C = None
        self.p: D = None
        self.t: F = None
        self.z: A = None
        self.txt = txt

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

a.t = h
a.x = c
a.r = i
h.t = c
h.u = c
h.s = d
h.z = m
h.p = a
h.x = g
c.r = g
c.q = m
c.u = m
c.o = h
c.s = a
c.y = i
g.v = c
g.w = c
g.x = c
g.z = i
g.y = i
g.r = i
g.q = h
m.q = a
m.x = i
d.z = i
d.q = i
d.y = m
i.q = e
i.w = e
i.r = m
i.u = h
i.x = h
i.o = g
e.u = h
e.o = c
e.p = g
e.t = d
e.z = a
assert d.y.x.u.p.r.u.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: C = None
        self.r: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: E = None
        self.o: B = None
        self.s: A = None
        self.y: G = None
        self.u: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: G = None
        self.w: C = None
        self.y: G = None
        self.x: C = None
        self.r: G = None
        self.q: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: E = None
        self.u: B = None
        self.x: B = None
        self.w: H = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: C = None
        self.p: D = None
        self.t: F = None
        self.z: A = None
        self.txt = txt

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

a.t = h
a.x = c
a.r = i
h.t = c
h.u = c
h.s = d
h.z = m
h.p = a
h.x = g
c.r = g
c.q = m
c.u = m
c.o = h
c.s = a
c.y = i
g.v = c
g.w = c
g.x = c
g.z = i
g.y = i
g.r = i
g.q = h
m.q = a
m.x = i
d.z = i
d.q = i
d.y = m
i.q = e
i.w = e
i.r = m
i.u = h
i.x = h
i.o = g
e.u = h
e.o = c
e.p = g
e.t = d
e.z = a
assert d.y.x.u.p.r.u.s.y.txt == "m"