class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: J = None
        self.y: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: C = None
        self.s: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: A = None
        self.q: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: F = None
        self.x: F = None
        self.o: G = None
        self.z: G = None
        self.q: C = None
        self.u: A = None
        self.s: B = None
        self.p: B = None
        self.r: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: C = None
        self.s: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: A = None
        self.q: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: F = None
        self.x: F = None
        self.o: G = None
        self.z: G = None
        self.q: C = None
        self.u: A = None
        self.s: B = None
        self.p: B = None
        self.r: C = None
        self.txt = txt

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

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