class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: B = None
        self.v: A = None
        self.z: C = None
        self.t: C = None
        self.w: I = None
        self.r: H = None
        self.o: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: D = None
        self.z: H = None
        self.t: E = None
        self.y: G = None
        self.s: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: A = None
        self.p: C = None
        self.v: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: F = None
        self.p: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: B = None
        self.v: A = None
        self.z: C = None
        self.t: C = None
        self.w: I = None
        self.r: H = None
        self.o: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: D = None
        self.z: H = None
        self.t: E = None
        self.y: G = None
        self.s: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: A = None
        self.p: C = None
        self.v: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: F = None
        self.p: B = None
        self.txt = txt

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

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