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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: A = None
        self.u: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: F = None
        self.q: D = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: C = None
        self.v: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: A = None
        self.u: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: F = None
        self.q: D = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: C = None
        self.v: B = None
        self.txt = txt

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

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

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