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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: E = None
        self.v: F = None
        self.p: D = None
        self.w: D = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: F = None
        self.v: E = None
        self.t: G = None
        self.s: F = None
        self.w: G = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: H = None
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: H = None
        self.z: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: E = None
        self.s: D = None
        self.p: F = None
        self.o: H = None
        self.txt = txt

n = A("n")
k = B("k")
m = C("m")
a = D("a")
j = E("j")
d = F("d")
b = G("b")
h = H("h")
l = H("l")

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: E = None
        self.v: F = None
        self.p: D = None
        self.w: D = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: F = None
        self.v: E = None
        self.t: G = None
        self.s: F = None
        self.w: G = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: H = None
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: H = None
        self.z: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: E = None
        self.s: D = None
        self.p: F = None
        self.o: H = None
        self.txt = txt

n = A("n")
k = B("k")
m = C("m")
a = D("a")
j = E("j")
d = F("d")
b = G("b")
h = H("h")
l = H("l")

n.r = m
n.s = j
n.x = j
n.v = a
k.q = a
k.p = a
k.w = a
k.x = a
k.o = j
k.v = d
m.x = n
m.o = n
m.u = d
m.s = d
m.v = j
m.t = b
m.w = b
a.s = j
a.t = h
a.v = k
j.o = k
j.x = h
j.z = l
d.p = n
d.r = b
b.w = h
h.z = k
h.r = j
h.s = a
h.p = d
h.o = l
l.z = k
l.r = j
l.s = a
l.p = d
l.o = h
assert k.p.v.o.z.p.txt == "d"