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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: J = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: A = None
        self.q: F = None
        self.z: C = None
        self.x: B = None
        self.y: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: H = None
        self.o: C = None
        self.q: C = None
        self.y: B = None
        self.txt = txt

e = A("e")
f = B("f")
d = C("d")
b = D("b")
g = E("g")
j = F("j")
n = G("n")
l = H("l")
m = I("m")
i = J("i")

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: J = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: A = None
        self.q: F = None
        self.z: C = None
        self.x: B = None
        self.y: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: H = None
        self.o: C = None
        self.q: C = None
        self.y: B = None
        self.txt = txt

e = A("e")
f = B("f")
d = C("d")
b = D("b")
g = E("g")
j = F("j")
n = G("n")
l = H("l")
m = I("m")
i = J("i")

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