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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: A = None
        self.z: A = None
        self.u: D = None
        self.o: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: E = None
        self.x: D = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: H = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: B = None
        self.w: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: A = None
        self.z: A = None
        self.u: D = None
        self.o: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: E = None
        self.x: D = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: H = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: B = None
        self.w: B = None
        self.txt = txt

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

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