class A:
    def __init__(self, txt: str):
        self.r: J = None
        self.y: C = None
        self.w: E = None
        self.u: B = None
        self.p: J = None
        self.t: I = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: J = None
        self.y: F = None
        self.z: E = None
        self.r: I = None
        self.t: G = None
        self.x: F = None
        self.w: B = None
        self.p: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: A = None
        self.t: G = None
        self.x: H = None
        self.p: F = None
        self.w: F = None
        self.q: I = None
        self.r: J = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: G = None
        self.s: G = None
        self.x: H = None
        self.q: A = None
        self.z: I = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: C = None
        self.p: C = None
        self.o: C = None
        self.t: J = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: H = None
        self.r: H = None
        self.y: B = None
        self.q: H = None
        self.t: H = None
        self.txt = txt

l = A("l")
g = B("g")
c = C("c")
e = D("e")
n = E("n")
a = F("a")
k = G("k")
d = H("d")
i = I("i")
h = J("h")

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: J = None
        self.y: F = None
        self.z: E = None
        self.r: I = None
        self.t: G = None
        self.x: F = None
        self.w: B = None
        self.p: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: A = None
        self.t: G = None
        self.x: H = None
        self.p: F = None
        self.w: F = None
        self.q: I = None
        self.r: J = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: G = None
        self.s: G = None
        self.x: H = None
        self.q: A = None
        self.z: I = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: C = None
        self.p: C = None
        self.o: C = None
        self.t: J = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: H = None
        self.r: H = None
        self.y: B = None
        self.q: H = None
        self.t: H = None
        self.txt = txt

l = A("l")
g = B("g")
c = C("c")
e = D("e")
n = E("n")
a = F("a")
k = G("k")
d = H("d")
i = I("i")
h = J("h")

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