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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

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

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

g.z = j
g.o = d
n.x = d
n.q = f
n.s = h
n.z = h
n.w = h
n.u = e
n.v = j
j.u = d
j.o = e
e.p = g
f.s = j
h.o = i
i.z = j
i.s = h
i.x = h
d.y = j
d.w = n
d.z = h
b.z = j
b.o = d
assert i.s.o.z.txt == "j"