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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: H = None
        self.u: A = None
        self.y: H = None
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: B = None
        self.q: F = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: F = None
        self.p: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: B = None
        self.p: D = None
        self.t: I = None
        self.s: G = None
        self.o: B = None
        self.q: I = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: E = None
        self.s: G = None
        self.x: G = None
        self.v: C = None
        self.z: H = None
        self.w: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: H = None
        self.u: A = None
        self.y: H = None
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: B = None
        self.q: F = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: F = None
        self.p: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: B = None
        self.p: D = None
        self.t: I = None
        self.s: G = None
        self.o: B = None
        self.q: I = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: E = None
        self.s: G = None
        self.x: G = None
        self.v: C = None
        self.z: H = None
        self.w: E = None
        self.txt = txt

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

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