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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.v: I = None
        self.z: D = None
        self.q: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.y: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: B = None
        self.q: D = None
        self.w: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.v: I = None
        self.z: D = None
        self.q: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.y: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: B = None
        self.q: D = None
        self.w: C = None
        self.txt = txt

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

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