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

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

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: B = None
        self.v: E = None
        self.y: H = None
        self.o: I = None
        self.u: E = None
        self.s: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.w: G = None
        self.s: F = None
        self.q: B = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: D = None
        self.r: C = None
        self.w: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: F = None
        self.q: E = None
        self.r: A = None
        self.t: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: B = None
        self.v: E = None
        self.y: H = None
        self.o: I = None
        self.u: E = None
        self.s: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.w: G = None
        self.s: F = None
        self.q: B = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: D = None
        self.r: C = None
        self.w: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: F = None
        self.q: E = None
        self.r: A = None
        self.t: D = None
        self.txt = txt

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

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

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