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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: H = None
        self.p: F = None
        self.z: E = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: H = None
        self.y: F = None
        self.s: F = None
        self.z: D = None
        self.r: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: G = None
        self.v: H = None
        self.u: G = None
        self.s: G = None
        self.r: F = None
        self.p: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: B = None
        self.u: F = None
        self.p: B = None
        self.v: A = None
        self.o: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: H = None
        self.p: F = None
        self.z: E = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: H = None
        self.y: F = None
        self.s: F = None
        self.z: D = None
        self.r: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: G = None
        self.v: H = None
        self.u: G = None
        self.s: G = None
        self.r: F = None
        self.p: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: B = None
        self.u: F = None
        self.p: B = None
        self.v: A = None
        self.o: G = None
        self.txt = txt

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

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