class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: D = None
        self.q: C = None
        self.r: B = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: C = None
        self.u: C = None
        self.o: A = None
        self.q: D = None
        self.r: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: D = None
        self.p: A = None
        self.y: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: C = None
        self.u: C = None
        self.o: A = None
        self.q: D = None
        self.r: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: D = None
        self.p: A = None
        self.y: D = None
        self.txt = txt

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

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