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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: H = None
        self.x: B = None
        self.r: A = None
        self.s: C = None
        self.p: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: F = None
        self.t: B = None
        self.q: E = None
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: H = None
        self.x: B = None
        self.r: A = None
        self.s: C = None
        self.p: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: F = None
        self.t: B = None
        self.q: E = None
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: C = None
        self.txt = txt

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

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