class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: H = None
        self.t: C = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: A = None
        self.u: E = None
        self.t: F = None
        self.w: J = None
        self.s: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: G = None
        self.u: I = None
        self.r: H = None
        self.x: G = None
        self.s: I = None
        self.p: D = None
        self.z: J = None
        self.y: I = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: I = None
        self.x: C = None
        self.r: A = None
        self.q: G = None
        self.y: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: A = None
        self.u: E = None
        self.t: F = None
        self.w: J = None
        self.s: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: G = None
        self.u: I = None
        self.r: H = None
        self.x: G = None
        self.s: I = None
        self.p: D = None
        self.z: J = None
        self.y: I = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: I = None
        self.x: C = None
        self.r: A = None
        self.q: G = None
        self.y: A = None
        self.txt = txt

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

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