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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: C = None
        self.x: C = None
        self.v: H = None
        self.q: H = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: A = None
        self.w: H = None
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: D = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: A = None
        self.p: I = None
        self.y: C = None
        self.z: A = None
        self.q: J = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: E = None
        self.x: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: B = None
        self.o: F = None
        self.z: I = None
        self.v: B = None
        self.w: G = None
        self.x: D = None
        self.p: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: C = None
        self.x: C = None
        self.v: H = None
        self.q: H = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: A = None
        self.w: H = None
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: D = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: A = None
        self.p: I = None
        self.y: C = None
        self.z: A = None
        self.q: J = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: E = None
        self.x: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: B = None
        self.o: F = None
        self.z: I = None
        self.v: B = None
        self.w: G = None
        self.x: D = None
        self.p: H = None
        self.txt = txt

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

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