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

class B:
    def __init__(self, txt: str):
        self.q: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: J = None
        self.q: I = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: I = None
        self.z: C = None
        self.u: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: J = None
        self.q: I = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: I = None
        self.z: C = None
        self.u: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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