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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: D = None
        self.t: B = None
        self.v: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

d = A("d")
j = B("j")
e = C("e")
l = D("l")
a = E("a")
n = F("n")
k = G("k")
g = D("g")

d.w = e
d.q = j
j.y = a
j.u = e
j.v = e
j.r = k
j.q = n
e.u = l
e.x = l
e.t = j
e.v = j
l.x = d
l.t = e
l.z = n
a.z = n
a.r = k
a.s = k
n.q = d
k.q = e
g.x = d
g.t = e
g.z = n
assert n.q.w.t.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: D = None
        self.t: B = None
        self.v: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

d = A("d")
j = B("j")
e = C("e")
l = D("l")
a = E("a")
n = F("n")
k = G("k")
g = D("g")

d.w = e
d.q = j
j.y = a
j.u = e
j.v = e
j.r = k
j.q = n
e.u = l
e.x = l
e.t = j
e.v = j
l.x = d
l.t = e
l.z = n
a.z = n
a.r = k
a.s = k
n.q = d
k.q = e
g.x = d
g.t = e
g.z = n
assert n.q.w.t.y.z.txt == "n"