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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.p: G = None
        self.x: E = None
        self.y: D = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: G = None
        self.q: F = None
        self.o: E = None
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: F = None
        self.s: H = None
        self.p: F = None
        self.t: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: B = None
        self.y: G = None
        self.v: B = None
        self.txt = txt

m = A("m")
n = B("n")
j = C("j")
c = D("c")
i = E("i")
k = F("k")
d = G("d")
l = H("l")

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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.p: G = None
        self.x: E = None
        self.y: D = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: G = None
        self.q: F = None
        self.o: E = None
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: F = None
        self.s: H = None
        self.p: F = None
        self.t: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: B = None
        self.y: G = None
        self.v: B = None
        self.txt = txt

m = A("m")
n = B("n")
j = C("j")
c = D("c")
i = E("i")
k = F("k")
d = G("d")
l = H("l")

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