class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: E = None
        self.r: E = None
        self.y: B = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: I = None
        self.v: G = None
        self.x: C = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: B = None
        self.t: C = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: A = None
        self.q: H = None
        self.v: D = None
        self.y: B = None
        self.s: B = None
        self.u: I = None
        self.x: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.w: I = None
        self.q: F = None
        self.o: B = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: H = None
        self.q: G = None
        self.v: C = None
        self.o: D = None
        self.u: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: I = None
        self.v: G = None
        self.x: C = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: B = None
        self.t: C = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: A = None
        self.q: H = None
        self.v: D = None
        self.y: B = None
        self.s: B = None
        self.u: I = None
        self.x: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.w: I = None
        self.q: F = None
        self.o: B = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: H = None
        self.q: G = None
        self.v: C = None
        self.o: D = None
        self.u: C = None
        self.txt = txt

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

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