class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: F = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: E = None
        self.y: B = None
        self.v: I = None
        self.w: D = None
        self.r: F = None
        self.q: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: B = None
        self.u: B = None
        self.r: A = None
        self.t: C = None
        self.x: F = None
        self.v: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: I = None
        self.t: F = None
        self.v: C = None
        self.u: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: A = None
        self.o: E = None
        self.z: G = None
        self.u: F = None
        self.x: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: F = None
        self.r: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: E = None
        self.y: B = None
        self.v: I = None
        self.w: D = None
        self.r: F = None
        self.q: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: B = None
        self.u: B = None
        self.r: A = None
        self.t: C = None
        self.x: F = None
        self.v: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: I = None
        self.t: F = None
        self.v: C = None
        self.u: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: A = None
        self.o: E = None
        self.z: G = None
        self.u: F = None
        self.x: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: F = None
        self.r: G = None
        self.txt = txt

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

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