class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: F = None
        self.w: H = None
        self.x: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.t: H = None
        self.v: A = None
        self.x: D = None
        self.s: H = None
        self.p: J = None
        self.y: E = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: B = None
        self.v: F = None
        self.r: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: J = None
        self.r: A = None
        self.p: G = None
        self.v: H = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: J = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

f.v = n
f.q = b
f.w = l
f.x = e
i.x = e
n.w = l
n.t = l
n.s = l
n.v = f
n.x = h
n.p = d
n.y = k
n.z = i
h.o = f
h.t = i
h.v = b
h.r = g
k.t = b
k.x = b
k.o = b
k.y = g
k.p = l
k.q = e
k.z = h
k.r = h
k.v = n
b.y = d
b.r = f
b.p = g
b.v = l
b.q = h
g.w = d
l.p = d
l.o = i
l.z = e
e.x = f
e.q = i
e.y = i
e.w = i
e.o = i
e.z = i
d.s = g
assert i.x.y.x.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: F = None
        self.w: H = None
        self.x: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.t: H = None
        self.v: A = None
        self.x: D = None
        self.s: H = None
        self.p: J = None
        self.y: E = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: B = None
        self.v: F = None
        self.r: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: J = None
        self.r: A = None
        self.p: G = None
        self.v: H = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: J = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

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