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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: G = None
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: A = None
        self.r: F = None
        self.p: G = None
        self.o: F = None
        self.q: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.p: H = None
        self.v: H = None
        self.x: H = None
        self.y: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: G = None
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: A = None
        self.r: F = None
        self.p: G = None
        self.o: F = None
        self.q: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.p: H = None
        self.v: H = None
        self.x: H = None
        self.y: D = None
        self.txt = txt

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

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

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