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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: C = None
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: A = None
        self.v: H = None
        self.r: A = None
        self.t: D = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: D = None
        self.t: C = None
        self.x: I = None
        self.o: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: C = None
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: A = None
        self.v: H = None
        self.r: A = None
        self.t: D = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: D = None
        self.t: C = None
        self.x: I = None
        self.o: G = None
        self.txt = txt

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

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

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