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

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: E = None
        self.s: A = None
        self.y: I = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.o: I = None
        self.q: D = None
        self.s: G = None
        self.u: C = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: E = None
        self.s: A = None
        self.y: I = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.o: I = None
        self.q: D = None
        self.s: G = None
        self.u: C = None
        self.w: C = None
        self.txt = txt

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

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

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

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