class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: H = None
        self.t: A = None
        self.r: A = None
        self.s: A = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: D = None
        self.r: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: H = None
        self.t: A = None
        self.r: A = None
        self.s: A = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: D = None
        self.r: D = None
        self.txt = txt

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

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