class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: G = None
        self.u: F = None
        self.z: D = None
        self.x: G = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: E = None
        self.o: D = None
        self.v: B = None
        self.x: H = None
        self.u: H = None
        self.p: B = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: F = None
        self.z: D = None
        self.w: D = None
        self.v: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.z: A = None
        self.r: G = None
        self.s: H = None
        self.w: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: G = None
        self.u: F = None
        self.z: D = None
        self.x: G = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: E = None
        self.o: D = None
        self.v: B = None
        self.x: H = None
        self.u: H = None
        self.p: B = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: F = None
        self.z: D = None
        self.w: D = None
        self.v: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.z: A = None
        self.r: G = None
        self.s: H = None
        self.w: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: C = None
        self.txt = txt

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

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

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