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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: E = None
        self.v: F = None
        self.txt = txt

k = A("k")
i = B("i")
a = C("a")
l = D("l")
n = E("n")
f = F("f")
c = G("c")
h = F("h")
d = G("d")
g = E("g")

k.q = l
k.z = g
i.x = a
i.p = a
i.q = f
i.y = h
a.s = l
a.u = i
a.w = g
l.q = d
l.x = i
l.u = i
l.z = f
n.t = h
f.x = i
f.r = i
f.q = d
f.u = d
f.t = l
f.v = g
c.z = h
c.w = n
c.v = f
h.x = i
h.r = i
h.q = d
h.t = l
h.u = c
h.v = g
d.z = h
d.w = n
d.v = f
g.t = h
assert d.w.t.t.q.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: E = None
        self.v: F = None
        self.txt = txt

k = A("k")
i = B("i")
a = C("a")
l = D("l")
n = E("n")
f = F("f")
c = G("c")
h = F("h")
d = G("d")
g = E("g")

k.q = l
k.z = g
i.x = a
i.p = a
i.q = f
i.y = h
a.s = l
a.u = i
a.w = g
l.q = d
l.x = i
l.u = i
l.z = f
n.t = h
f.x = i
f.r = i
f.q = d
f.u = d
f.t = l
f.v = g
c.z = h
c.w = n
c.v = f
h.x = i
h.r = i
h.q = d
h.t = l
h.u = c
h.v = g
d.z = h
d.w = n
d.v = f
g.t = h
assert d.w.t.t.q.w.txt == "n"