class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: A = None
        self.x: F = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: H = None
        self.txt = txt

b = A("b")
j = B("j")
c = C("c")
l = D("l")
i = E("i")
d = F("d")
a = G("a")
h = H("h")
k = I("k")

b.z = h
j.o = d
j.x = d
j.y = b
j.z = i
c.s = h
c.t = b
l.o = a
l.u = d
i.q = k
i.s = k
i.z = j
i.v = l
d.w = i
d.z = i
d.t = c
d.s = b
a.r = b
a.s = j
a.o = j
a.x = j
a.p = l
a.v = c
a.z = h
a.q = d
h.z = i
k.v = b
k.q = h
assert d.t.s.z.z.o.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: A = None
        self.x: F = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: H = None
        self.txt = txt

b = A("b")
j = B("j")
c = C("c")
l = D("l")
i = E("i")
d = F("d")
a = G("a")
h = H("h")
k = I("k")

b.z = h
j.o = d
j.x = d
j.y = b
j.z = i
c.s = h
c.t = b
l.o = a
l.u = d
i.q = k
i.s = k
i.z = j
i.v = l
d.w = i
d.z = i
d.t = c
d.s = b
a.r = b
a.s = j
a.o = j
a.x = j
a.p = l
a.v = c
a.z = h
a.q = d
h.z = i
k.v = b
k.q = h
assert d.t.s.z.z.o.s.z.txt == "h"