class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

f = A("f")
m = B("m")
e = C("e")
k = D("k")
n = E("n")
i = F("i")
h = G("h")
b = G("b")

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

f = A("f")
m = B("m")
e = C("e")
k = D("k")
n = E("n")
i = F("i")
h = G("h")
b = G("b")

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