class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: D = None
        self.w: F = None
        self.x: B = None
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: G = None
        self.u: J = None
        self.p: E = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: A = None
        self.r: H = None
        self.u: H = None
        self.v: A = None
        self.x: H = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: A = None
        self.o: G = None
        self.v: D = None
        self.r: H = None
        self.x: J = None
        self.p: J = None
        self.t: J = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: G = None
        self.x: D = None
        self.z: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.q: D = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: J = None
        self.y: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: D = None
        self.w: A = None
        self.s: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: G = None
        self.u: J = None
        self.p: E = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: A = None
        self.r: H = None
        self.u: H = None
        self.v: A = None
        self.x: H = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: A = None
        self.o: G = None
        self.v: D = None
        self.r: H = None
        self.x: J = None
        self.p: J = None
        self.t: J = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: G = None
        self.x: D = None
        self.z: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.q: D = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: J = None
        self.y: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: D = None
        self.w: A = None
        self.s: A = None
        self.txt = txt

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

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