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

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

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: E = None
        self.q: G = None
        self.t: H = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: I = None
        self.w: C = None
        self.y: H = None
        self.t: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: I = None
        self.q: A = None
        self.x: E = None
        self.t: C = None
        self.v: D = None
        self.u: C = None
        self.o: A = None
        self.w: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: C = None
        self.u: B = None
        self.w: A = None
        self.r: A = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: E = None
        self.q: G = None
        self.t: H = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: I = None
        self.w: C = None
        self.y: H = None
        self.t: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: I = None
        self.q: A = None
        self.x: E = None
        self.t: C = None
        self.v: D = None
        self.u: C = None
        self.o: A = None
        self.w: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: C = None
        self.u: B = None
        self.w: A = None
        self.r: A = None
        self.txt = txt

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

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

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

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