class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: I = None
        self.t: G = None
        self.z: C = None
        self.w: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: I = None
        self.v: F = None
        self.w: I = None
        self.r: B = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: G = None
        self.r: G = None
        self.s: B = None
        self.v: B = None
        self.x: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: H = None
        self.p: D = None
        self.x: G = None
        self.u: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: I = None
        self.v: F = None
        self.w: I = None
        self.r: B = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: G = None
        self.r: G = None
        self.s: B = None
        self.v: B = None
        self.x: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: H = None
        self.p: D = None
        self.x: G = None
        self.u: E = None
        self.txt = txt

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

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