class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.u: I = None
        self.t: F = None
        self.w: F = None
        self.s: F = None
        self.x: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.w: I = None
        self.s: A = None
        self.z: B = None
        self.x: F = None
        self.r: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: A = None
        self.x: A = None
        self.u: H = None
        self.y: C = None
        self.p: J = None
        self.o: J = None
        self.z: I = None
        self.s: I = None
        self.r: H = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: D = None
        self.o: J = None
        self.z: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: D = None
        self.x: G = None
        self.w: E = None
        self.txt = txt

b = A("b")
i = B("i")
c = C("c")
l = D("l")
k = E("k")
g = F("g")
a = G("a")
m = H("m")
d = I("d")
f = J("f")

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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.w: I = None
        self.s: A = None
        self.z: B = None
        self.x: F = None
        self.r: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: A = None
        self.x: A = None
        self.u: H = None
        self.y: C = None
        self.p: J = None
        self.o: J = None
        self.z: I = None
        self.s: I = None
        self.r: H = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: D = None
        self.o: J = None
        self.z: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: D = None
        self.x: G = None
        self.w: E = None
        self.txt = txt

b = A("b")
i = B("i")
c = C("c")
l = D("l")
k = E("k")
g = F("g")
a = G("a")
m = H("m")
d = I("d")
f = J("f")

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