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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: H = None
        self.q: C = None
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: G = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: H = None
        self.w: H = None
        self.v: B = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: H = None
        self.q: C = None
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: G = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: H = None
        self.w: H = None
        self.v: B = None
        self.p: F = None
        self.txt = txt

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

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