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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: E = None
        self.v: A = None
        self.u: E = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: C = None
        self.v: B = None
        self.t: D = None
        self.y: D = None
        self.x: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: E = None
        self.v: A = None
        self.u: E = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: C = None
        self.v: B = None
        self.t: D = None
        self.y: D = None
        self.x: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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