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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: D = None
        self.o: H = None
        self.t: A = None
        self.x: C = None
        self.w: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: D = None
        self.y: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.s: F = None
        self.p: D = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: H = None
        self.t: D = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: D = None
        self.v: F = None
        self.y: D = None
        self.x: A = None
        self.o: A = None
        self.s: G = None
        self.z: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: G = None
        self.t: G = None
        self.txt = txt

i = A("i")
h = B("h")
g = C("g")
k = D("k")
j = E("j")
n = F("n")
c = G("c")
a = H("a")
d = G("d")
f = D("f")

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: D = None
        self.o: H = None
        self.t: A = None
        self.x: C = None
        self.w: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: D = None
        self.y: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.s: F = None
        self.p: D = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: H = None
        self.t: D = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: D = None
        self.v: F = None
        self.y: D = None
        self.x: A = None
        self.o: A = None
        self.s: G = None
        self.z: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: G = None
        self.t: G = None
        self.txt = txt

i = A("i")
h = B("h")
g = C("g")
k = D("k")
j = E("j")
n = F("n")
c = G("c")
a = H("a")
d = G("d")
f = D("f")

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