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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: I = None
        self.q: I = None
        self.p: I = None
        self.x: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: J = None
        self.r: I = None
        self.w: E = None
        self.v: A = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: J = None
        self.x: B = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: B = None
        self.u: H = None
        self.r: I = None
        self.p: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: I = None
        self.q: I = None
        self.p: I = None
        self.x: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: J = None
        self.r: I = None
        self.w: E = None
        self.v: A = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: J = None
        self.x: B = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: B = None
        self.u: H = None
        self.r: I = None
        self.p: G = None
        self.txt = txt

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

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