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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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