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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: B = None
        self.q: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: B = None
        self.q: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

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

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