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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: H = None
        self.o: F = None
        self.r: H = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.u: C = None
        self.r: E = None
        self.v: E = None
        self.s: I = None
        self.p: I = None
        self.w: I = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: G = None
        self.v: E = None
        self.w: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: H = None
        self.o: F = None
        self.r: H = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.u: C = None
        self.r: E = None
        self.v: E = None
        self.s: I = None
        self.p: I = None
        self.w: I = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: G = None
        self.v: E = None
        self.w: C = None
        self.txt = txt

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

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

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