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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: E = None
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.p: A = None
        self.u: I = None
        self.y: F = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: C = None
        self.o: F = None
        self.u: F = None
        self.y: I = None
        self.w: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: G = None
        self.x: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: F = None
        self.s: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: E = None
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.p: A = None
        self.u: I = None
        self.y: F = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: C = None
        self.o: F = None
        self.u: F = None
        self.y: I = None
        self.w: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: G = None
        self.x: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: F = None
        self.s: F = None
        self.txt = txt

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

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