class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: D = None
        self.p: F = None
        self.x: C = None
        self.w: E = None
        self.t: H = None
        self.y: B = None
        self.q: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: G = None
        self.y: H = None
        self.t: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: B = None
        self.z: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: F = None
        self.z: D = None
        self.t: H = None
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: B = None
        self.s: A = None
        self.q: E = None
        self.w: E = None
        self.z: H = None
        self.txt = txt

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

e = A("e")
g = B("g")
j = C("j")
d = D("d")
c = E("c")
k = F("k")
h = G("h")
l = H("l")
f = F("f")
n = E("n")

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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: G = None
        self.y: H = None
        self.t: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: B = None
        self.z: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: F = None
        self.z: D = None
        self.t: H = None
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: B = None
        self.s: A = None
        self.q: E = None
        self.w: E = None
        self.z: H = None
        self.txt = txt

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

e = A("e")
g = B("g")
j = C("j")
d = D("d")
c = E("c")
k = F("k")
h = G("h")
l = H("l")
f = F("f")
n = E("n")

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