class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: H = None
        self.v: C = None
        self.u: G = None
        self.p: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: H = None
        self.r: G = None
        self.x: A = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: D = None
        self.r: G = None
        self.x: B = None
        self.t: A = None
        self.p: D = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: E = None
        self.t: H = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: G = None
        self.x: A = None
        self.p: E = None
        self.txt = txt

f = A("f")
g = B("g")
a = C("a")
n = D("n")
j = E("j")
k = F("k")
m = G("m")
h = H("h")
e = A("e")
b = C("b")

f.x = a
f.r = h
f.v = b
f.u = m
f.p = m
g.o = n
g.z = n
g.r = e
g.q = m
g.v = m
a.s = m
a.r = m
a.u = h
a.x = f
a.t = k
n.y = e
n.q = e
j.s = n
k.y = g
k.x = g
k.q = n
k.p = n
k.r = m
k.t = e
k.s = f
m.s = e
m.y = j
m.t = h
m.r = g
h.y = a
h.w = m
h.x = e
h.p = j
e.x = a
e.v = a
e.r = h
e.u = m
e.p = m
b.s = m
b.r = m
b.u = h
b.x = f
b.t = k
assert f.r.y.u.w.r.z.y.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: H = None
        self.v: C = None
        self.u: G = None
        self.p: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: H = None
        self.r: G = None
        self.x: A = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: D = None
        self.r: G = None
        self.x: B = None
        self.t: A = None
        self.p: D = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: E = None
        self.t: H = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: G = None
        self.x: A = None
        self.p: E = None
        self.txt = txt

f = A("f")
g = B("g")
a = C("a")
n = D("n")
j = E("j")
k = F("k")
m = G("m")
h = H("h")
e = A("e")
b = C("b")

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