class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: F = None
        self.w: D = None
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: D = None
        self.v: G = None
        self.p: F = None
        self.s: E = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: E = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: H = None
        self.s: H = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: A = None
        self.o: G = None
        self.v: D = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: G = None
        self.x: A = None
        self.w: E = None
        self.p: B = None
        self.r: H = None
        self.t: G = None
        self.y: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: C = None
        self.q: A = None
        self.z: B = None
        self.o: F = None
        self.txt = txt

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

i = A("i")
e = B("e")
m = C("m")
f = D("f")
k = E("k")
j = F("j")
g = G("g")
d = H("d")

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: D = None
        self.v: G = None
        self.p: F = None
        self.s: E = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: E = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: H = None
        self.s: H = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: A = None
        self.o: G = None
        self.v: D = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: G = None
        self.x: A = None
        self.w: E = None
        self.p: B = None
        self.r: H = None
        self.t: G = None
        self.y: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: C = None
        self.q: A = None
        self.z: B = None
        self.o: F = None
        self.txt = txt

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

i = A("i")
e = B("e")
m = C("m")
f = D("f")
k = E("k")
j = F("j")
g = G("g")
d = H("d")

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