class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: A = None
        self.x: G = None
        self.w: D = None
        self.p: H = None
        self.z: G = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: A = None
        self.s: A = None
        self.o: B = None
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: B = None
        self.v: D = None
        self.x: F = None
        self.y: C = None
        self.w: A = None
        self.o: D = None
        self.q: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: H = None
        self.o: A = None
        self.w: C = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: A = None
        self.y: F = None
        self.x: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: A = None
        self.x: G = None
        self.w: D = None
        self.p: H = None
        self.z: G = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: A = None
        self.s: A = None
        self.o: B = None
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: B = None
        self.v: D = None
        self.x: F = None
        self.y: C = None
        self.w: A = None
        self.o: D = None
        self.q: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: H = None
        self.o: A = None
        self.w: C = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: A = None
        self.y: F = None
        self.x: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: G = None
        self.txt = txt

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

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