class A:
    def __init__(self, txt: str):
        self.v: I = None
        self.p: D = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: I = None
        self.w: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: D = None
        self.q: A = None
        self.s: J = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.q: G = None
        self.w: A = None
        self.x: J = None
        self.p: G = None
        self.r: G = None
        self.u: D = None
        self.o: H = None
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: I = None
        self.v: H = None
        self.u: B = None
        self.t: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: H = None
        self.z: D = None
        self.x: A = None
        self.p: A = None
        self.r: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: F = None
        self.p: I = None
        self.u: H = None
        self.txt = txt

a = A("a")
k = B("k")
l = C("l")
i = D("i")
m = E("m")
g = F("g")
c = G("c")
j = H("j")
h = I("h")
f = J("f")

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

class B:
    def __init__(self, txt: str):
        self.u: I = None
        self.w: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: D = None
        self.q: A = None
        self.s: J = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.q: G = None
        self.w: A = None
        self.x: J = None
        self.p: G = None
        self.r: G = None
        self.u: D = None
        self.o: H = None
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: I = None
        self.v: H = None
        self.u: B = None
        self.t: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: H = None
        self.z: D = None
        self.x: A = None
        self.p: A = None
        self.r: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: F = None
        self.p: I = None
        self.u: H = None
        self.txt = txt

a = A("a")
k = B("k")
l = C("l")
i = D("i")
m = E("m")
g = F("g")
c = G("c")
j = H("j")
h = I("h")
f = J("f")

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