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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: I = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: E = None
        self.q: J = None
        self.y: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: F = None
        self.o: B = None
        self.z: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: I = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: E = None
        self.q: J = None
        self.y: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: F = None
        self.o: B = None
        self.z: C = None
        self.txt = txt

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

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

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