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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: H = None
        self.u: B = None
        self.x: D = None
        self.z: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: C = None
        self.x: B = None
        self.q: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: F = None
        self.s: G = None
        self.x: G = None
        self.txt = txt

n = A("n")
j = B("j")
h = C("h")
a = D("a")
f = E("f")
m = F("m")
d = G("d")
l = H("l")
c = I("c")

n.t = m
n.v = f
n.x = f
j.r = n
h.t = d
h.v = d
h.w = a
h.o = n
h.x = c
h.z = f
a.r = l
a.u = l
a.p = j
a.w = f
f.p = a
f.x = a
f.v = l
f.u = j
f.z = m
m.z = d
d.s = m
d.w = h
d.x = j
d.q = f
l.w = n
l.x = n
l.v = j
l.z = m
l.u = m
l.s = h
l.q = h
l.p = d
l.t = d
c.z = d
c.s = d
c.x = d
c.t = m
assert d.w.t.x.r.t.z.q.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: E = None
        self.x: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: H = None
        self.u: B = None
        self.x: D = None
        self.z: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: C = None
        self.x: B = None
        self.q: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: F = None
        self.s: G = None
        self.x: G = None
        self.txt = txt

n = A("n")
j = B("j")
h = C("h")
a = D("a")
f = E("f")
m = F("m")
d = G("d")
l = H("l")
c = I("c")

n.t = m
n.v = f
n.x = f
j.r = n
h.t = d
h.v = d
h.w = a
h.o = n
h.x = c
h.z = f
a.r = l
a.u = l
a.p = j
a.w = f
f.p = a
f.x = a
f.v = l
f.u = j
f.z = m
m.z = d
d.s = m
d.w = h
d.x = j
d.q = f
l.w = n
l.x = n
l.v = j
l.z = m
l.u = m
l.s = h
l.q = h
l.p = d
l.t = d
c.z = d
c.s = d
c.x = d
c.t = m
assert d.w.t.x.r.t.z.q.v.s.txt == "h"