class A:
    def __init__(self, txt: str):
        self.o: H = None
        self.y: C = None
        self.x: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.t: I = None
        self.s: G = None
        self.r: G = None
        self.w: H = None
        self.u: D = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: H = None
        self.x: A = None
        self.r: I = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.t: I = None
        self.s: G = None
        self.r: G = None
        self.w: H = None
        self.u: D = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: H = None
        self.x: A = None
        self.r: I = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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