class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: A = None
        self.y: A = None
        self.t: C = None
        self.r: A = None
        self.u: D = None
        self.txt = txt

k = A("k")
c = B("c")
d = C("d")
b = D("b")
f = E("f")
h = F("h")
g = G("g")
m = H("m")

k.z = m
k.q = f
c.w = d
c.x = h
d.w = g
d.v = k
b.x = d
b.y = c
b.t = k
b.v = k
b.r = g
f.s = b
h.s = k
h.w = m
g.s = k
g.u = k
g.w = c
g.z = m
g.o = m
g.y = h
g.q = d
m.p = b
m.u = b
m.x = k
m.y = k
m.r = k
m.t = d
assert g.w.x.w.u.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: A = None
        self.y: A = None
        self.t: C = None
        self.r: A = None
        self.u: D = None
        self.txt = txt

k = A("k")
c = B("c")
d = C("d")
b = D("b")
f = E("f")
h = F("h")
g = G("g")
m = H("m")

k.z = m
k.q = f
c.w = d
c.x = h
d.w = g
d.v = k
b.x = d
b.y = c
b.t = k
b.v = k
b.r = g
f.s = b
h.s = k
h.w = m
g.s = k
g.u = k
g.w = c
g.z = m
g.o = m
g.y = h
g.q = d
m.p = b
m.u = b
m.x = k
m.y = k
m.r = k
m.t = d
assert g.w.x.w.u.v.txt == "k"