class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: E = None
        self.v: I = None
        self.s: B = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: A = None
        self.y: I = None
        self.x: A = None
        self.v: A = None
        self.w: D = None
        self.s: E = None
        self.o: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: G = None
        self.v: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: A = None
        self.y: I = None
        self.x: A = None
        self.v: A = None
        self.w: D = None
        self.s: E = None
        self.o: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: G = None
        self.v: D = None
        self.txt = txt

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

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