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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: G = None
        self.v: C = None
        self.z: B = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: E = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: G = None
        self.v: C = None
        self.z: B = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: E = None
        self.y: A = None
        self.txt = txt

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

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

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