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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.r: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: A = None
        self.o: I = None
        self.p: A = None
        self.q: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: H = None
        self.x: C = None
        self.r: H = None
        self.s: E = None
        self.t: A = None
        self.o: G = None
        self.w: C = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.r: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: A = None
        self.o: I = None
        self.p: A = None
        self.q: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: H = None
        self.x: C = None
        self.r: H = None
        self.s: E = None
        self.t: A = None
        self.o: G = None
        self.w: C = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

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