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

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

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: D = None
        self.y: B = None
        self.p: B = None
        self.o: H = None
        self.q: B = None
        self.w: G = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.t: I = None
        self.p: F = None
        self.u: D = None
        self.r: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: C = None
        self.r: G = None
        self.o: G = None
        self.y: G = None
        self.w: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: B = None
        self.u: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: D = None
        self.y: B = None
        self.p: B = None
        self.o: H = None
        self.q: B = None
        self.w: G = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.t: I = None
        self.p: F = None
        self.u: D = None
        self.r: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: C = None
        self.r: G = None
        self.o: G = None
        self.y: G = None
        self.w: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: B = None
        self.u: B = None
        self.txt = txt

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

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