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

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: F = None
        self.w: A = None
        self.t: A = None
        self.q: A = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: F = None
        self.x: E = None
        self.w: B = None
        self.v: D = None
        self.q: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: C = None
        self.z: E = None
        self.x: C = None
        self.t: A = None
        self.y: A = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: F = None
        self.w: A = None
        self.t: A = None
        self.q: A = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: F = None
        self.x: E = None
        self.w: B = None
        self.v: D = None
        self.q: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: C = None
        self.z: E = None
        self.x: C = None
        self.t: A = None
        self.y: A = None
        self.p: D = None
        self.txt = txt

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

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

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

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