class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.s: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: D = None
        self.y: D = None
        self.p: I = None
        self.u: J = None
        self.t: B = None
        self.s: J = None
        self.x: D = None
        self.w: D = None
        self.v: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: G = None
        self.r: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: I = None
        self.r: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.s: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: D = None
        self.y: D = None
        self.p: I = None
        self.u: J = None
        self.t: B = None
        self.s: J = None
        self.x: D = None
        self.w: D = None
        self.v: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: G = None
        self.r: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: I = None
        self.r: B = None
        self.txt = txt

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

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