class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: H = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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