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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: B = None
        self.w: C = None
        self.o: A = None
        self.x: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: B = None
        self.w: C = None
        self.o: A = None
        self.x: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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