class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: H = None
        self.w: B = None
        self.t: B = None
        self.z: I = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.o: I = None
        self.w: E = None
        self.r: B = None
        self.y: E = None
        self.q: B = None
        self.t: G = None
        self.u: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: H = None
        self.w: B = None
        self.t: B = None
        self.z: I = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.o: I = None
        self.w: E = None
        self.r: B = None
        self.y: E = None
        self.q: B = None
        self.t: G = None
        self.u: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

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