class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: B = None
        self.v: H = None
        self.q: F = None
        self.p: E = None
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: C = None
        self.w: G = None
        self.t: A = None
        self.z: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: H = None
        self.z: B = None
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

m = A("m")
j = B("j")
d = C("d")
n = D("n")
e = E("e")
g = F("g")
a = G("a")
i = H("i")
h = B("h")

m.o = d
j.y = a
j.x = m
j.u = m
j.o = d
j.v = i
j.t = n
j.r = e
d.t = n
d.w = h
d.u = h
d.v = i
d.q = g
d.p = e
n.v = d
n.r = g
n.o = h
n.z = a
n.x = a
e.s = m
e.t = m
e.r = d
e.w = a
e.z = i
g.y = h
g.u = h
g.p = e
g.t = i
g.s = i
g.z = d
a.x = n
a.q = i
a.z = h
a.t = m
i.p = g
h.y = a
h.x = m
h.u = m
h.o = d
h.v = i
h.t = n
h.r = e
assert d.v.p.t.p.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: B = None
        self.v: H = None
        self.q: F = None
        self.p: E = None
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: C = None
        self.w: G = None
        self.t: A = None
        self.z: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: H = None
        self.z: B = None
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

m = A("m")
j = B("j")
d = C("d")
n = D("n")
e = E("e")
g = F("g")
a = G("a")
i = H("i")
h = B("h")

m.o = d
j.y = a
j.x = m
j.u = m
j.o = d
j.v = i
j.t = n
j.r = e
d.t = n
d.w = h
d.u = h
d.v = i
d.q = g
d.p = e
n.v = d
n.r = g
n.o = h
n.z = a
n.x = a
e.s = m
e.t = m
e.r = d
e.w = a
e.z = i
g.y = h
g.u = h
g.p = e
g.t = i
g.s = i
g.z = d
a.x = n
a.q = i
a.z = h
a.t = m
i.p = g
h.y = a
h.x = m
h.u = m
h.o = d
h.v = i
h.t = n
h.r = e
assert d.v.p.t.p.z.v.txt == "i"