class A:
    def __init__(self, txt: str):
        self.q: I = None
        self.s: C = None
        self.w: I = None
        self.u: D = None
        self.p: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: C = None
        self.u: D = None
        self.z: E = None
        self.w: H = None
        self.r: D = None
        self.y: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: G = None
        self.u: A = None
        self.y: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: G = None
        self.o: F = None
        self.txt = txt

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

f.q = k
f.w = k
f.s = c
f.u = h
f.p = i
b.q = c
b.o = f
c.u = f
h.y = k
h.w = k
h.t = c
h.o = c
h.z = i
h.r = b
g.u = c
g.p = k
g.s = h
j.p = c
j.s = c
j.u = h
j.r = h
j.z = g
j.y = g
j.w = m
i.x = f
i.t = f
i.s = c
m.r = g
m.x = i
m.u = f
m.y = f
k.t = b
k.s = i
k.o = j
assert m.r.u.u.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.q: I = None
        self.s: C = None
        self.w: I = None
        self.u: D = None
        self.p: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: C = None
        self.u: D = None
        self.z: E = None
        self.w: H = None
        self.r: D = None
        self.y: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: G = None
        self.u: A = None
        self.y: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: G = None
        self.o: F = None
        self.txt = txt

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

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