class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: B = None
        self.q: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: H = None
        self.w: G = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: G = None
        self.o: E = None
        self.s: F = None
        self.q: H = None
        self.u: C = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: B = None
        self.s: B = None
        self.x: E = None
        self.w: C = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: F = None
        self.z: C = None
        self.y: H = None
        self.x: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: A = None
        self.y: A = None
        self.w: D = None
        self.p: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: H = None
        self.w: G = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: G = None
        self.o: E = None
        self.s: F = None
        self.q: H = None
        self.u: C = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: B = None
        self.s: B = None
        self.x: E = None
        self.w: C = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: F = None
        self.z: C = None
        self.y: H = None
        self.x: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: A = None
        self.y: A = None
        self.w: D = None
        self.p: F = None
        self.txt = txt

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

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