class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: D = None
        self.o: F = None
        self.r: C = None
        self.p: A = None
        self.q: G = None
        self.z: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: F = None
        self.z: F = None
        self.t: B = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: C = None
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: E = None
        self.txt = txt

m = A("m")
n = B("n")
k = C("k")
g = D("g")
i = E("i")
h = F("h")
a = G("a")
d = C("d")

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: D = None
        self.o: F = None
        self.r: C = None
        self.p: A = None
        self.q: G = None
        self.z: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: F = None
        self.z: F = None
        self.t: B = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: C = None
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: E = None
        self.txt = txt

m = A("m")
n = B("n")
k = C("k")
g = D("g")
i = E("i")
h = F("h")
a = G("a")
d = C("d")

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