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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: G = None
        self.p: I = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: F = None
        self.p: C = None
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: I = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: G = None
        self.p: I = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: F = None
        self.p: C = None
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: I = None
        self.txt = txt

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

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

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