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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: A = None
        self.r: G = None
        self.u: I = None
        self.y: A = None
        self.t: D = None
        self.p: A = None
        self.v: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: H = None
        self.t: D = None
        self.y: H = None
        self.u: H = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: A = None
        self.r: G = None
        self.u: I = None
        self.y: A = None
        self.t: D = None
        self.p: A = None
        self.v: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: H = None
        self.t: D = None
        self.y: H = None
        self.u: H = None
        self.w: C = None
        self.txt = txt

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

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