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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: A = None
        self.r: E = None
        self.q: E = None
        self.t: D = None
        self.v: H = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: G = None
        self.y: H = None
        self.r: F = None
        self.v: H = None
        self.z: D = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

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

h.z = f
h.x = b
h.v = m
c.o = n
c.x = h
c.r = f
c.q = f
c.t = d
c.v = e
c.s = m
m.o = b
m.x = b
m.y = e
m.v = e
m.r = n
m.z = d
m.s = d
d.q = f
f.x = h
n.x = h
n.o = d
n.z = m
n.s = c
b.s = d
b.q = d
b.w = c
b.v = f
b.z = f
b.y = m
e.t = b
e.r = b
e.q = b
e.u = h
e.y = h
assert b.y.r.x.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: G = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: A = None
        self.r: E = None
        self.q: E = None
        self.t: D = None
        self.v: H = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: G = None
        self.y: H = None
        self.r: F = None
        self.v: H = None
        self.z: D = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

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

h.z = f
h.x = b
h.v = m
c.o = n
c.x = h
c.r = f
c.q = f
c.t = d
c.v = e
c.s = m
m.o = b
m.x = b
m.y = e
m.v = e
m.r = n
m.z = d
m.s = d
d.q = f
f.x = h
n.x = h
n.o = d
n.z = m
n.s = c
b.s = d
b.q = d
b.w = c
b.v = f
b.z = f
b.y = m
e.t = b
e.r = b
e.q = b
e.u = h
e.y = h
assert b.y.r.x.z.x.txt == "h"