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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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