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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: D = None
        self.t: F = None
        self.o: F = None
        self.q: E = None
        self.x: G = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: J = None
        self.o: J = None
        self.x: F = None
        self.v: J = None
        self.s: A = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: I = None
        self.p: B = None
        self.s: C = None
        self.t: J = None
        self.z: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: H = None
        self.p: J = None
        self.r: J = None
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: H = None
        self.z: H = None
        self.o: I = None
        self.y: B = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: D = None
        self.t: F = None
        self.o: F = None
        self.q: E = None
        self.x: G = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: J = None
        self.o: J = None
        self.x: F = None
        self.v: J = None
        self.s: A = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: I = None
        self.p: B = None
        self.s: C = None
        self.t: J = None
        self.z: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: H = None
        self.p: J = None
        self.r: J = None
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: H = None
        self.z: H = None
        self.o: I = None
        self.y: B = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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