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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: C = None
        self.v: B = None
        self.x: H = None
        self.z: B = None
        self.y: C = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

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

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

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

n = A("n")
m = B("m")
g = C("g")
f = D("f")
i = E("i")
l = F("l")
k = G("k")
h = H("h")
d = B("d")

n.t = d
m.r = l
m.w = g
m.y = g
m.u = g
m.v = d
m.z = d
m.x = h
g.s = k
g.v = l
f.u = h
i.w = l
l.q = g
l.z = k
k.y = g
h.v = l
h.o = d
h.y = n
h.t = n
h.r = k
h.z = i
h.x = f
d.r = l
d.w = g
d.y = g
d.u = g
d.v = m
d.z = m
d.x = h
assert m.r.z.y.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: C = None
        self.v: B = None
        self.x: H = None
        self.z: B = None
        self.y: C = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

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

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

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

n = A("n")
m = B("m")
g = C("g")
f = D("f")
i = E("i")
l = F("l")
k = G("k")
h = H("h")
d = B("d")

n.t = d
m.r = l
m.w = g
m.y = g
m.u = g
m.v = d
m.z = d
m.x = h
g.s = k
g.v = l
f.u = h
i.w = l
l.q = g
l.z = k
k.y = g
h.v = l
h.o = d
h.y = n
h.t = n
h.r = k
h.z = i
h.x = f
d.r = l
d.w = g
d.y = g
d.u = g
d.v = m
d.z = m
d.x = h
assert m.r.z.y.s.y.txt == "g"