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

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: I = None
        self.w: J = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: J = None
        self.q: I = None
        self.o: A = None
        self.z: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: H = None
        self.q: I = None
        self.w: F = None
        self.x: A = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: D = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: F = None
        self.u: H = None
        self.x: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: E = None
        self.x: J = None
        self.p: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: B = None
        self.q: D = None
        self.s: C = None
        self.txt = txt

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

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

g.w = j
g.s = m
b.v = k
b.x = j
b.w = n
b.u = e
f.t = e
f.x = n
f.z = n
f.q = j
f.o = g
e.u = l
e.t = l
e.p = k
e.q = j
e.w = m
e.x = g
a.o = m
a.q = e
a.v = e
m.w = l
m.p = f
l.z = m
l.s = m
l.u = k
l.x = k
k.v = j
k.o = a
k.x = n
k.p = m
j.t = m
j.v = b
j.q = e
j.s = f
n.t = g
n.z = m
assert l.x.p.p.z.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.w: I = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: I = None
        self.w: J = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: J = None
        self.q: I = None
        self.o: A = None
        self.z: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: H = None
        self.q: I = None
        self.w: F = None
        self.x: A = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: D = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: F = None
        self.u: H = None
        self.x: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.o: E = None
        self.x: J = None
        self.p: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: B = None
        self.q: D = None
        self.s: C = None
        self.txt = txt

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

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

g.w = j
g.s = m
b.v = k
b.x = j
b.w = n
b.u = e
f.t = e
f.x = n
f.z = n
f.q = j
f.o = g
e.u = l
e.t = l
e.p = k
e.q = j
e.w = m
e.x = g
a.o = m
a.q = e
a.v = e
m.w = l
m.p = f
l.z = m
l.s = m
l.u = k
l.x = k
k.v = j
k.o = a
k.x = n
k.p = m
j.t = m
j.v = b
j.q = e
j.s = f
n.t = g
n.z = m
assert l.x.p.p.z.z.p.txt == "f"