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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: I = None
        self.z: E = None
        self.s: E = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: D = None
        self.o: I = None
        self.u: J = None
        self.q: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: G = None
        self.x: H = None
        self.o: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: I = None
        self.o: C = None
        self.v: I = None
        self.s: A = None
        self.x: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: A = None
        self.w: B = None
        self.z: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: I = None
        self.z: E = None
        self.s: E = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: D = None
        self.o: I = None
        self.u: J = None
        self.q: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: G = None
        self.x: H = None
        self.o: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: I = None
        self.o: C = None
        self.v: I = None
        self.s: A = None
        self.x: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: A = None
        self.w: B = None
        self.z: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

f.s = h
e.v = a
e.o = j
e.z = m
e.s = m
e.q = m
h.x = a
h.s = g
h.o = j
h.q = j
h.u = k
g.p = m
g.u = a
g.o = a
g.x = c
m.o = e
d.p = g
d.u = j
d.v = j
d.o = h
d.s = f
d.x = k
a.q = c
c.p = a
c.q = f
c.w = e
c.z = h
j.z = e
j.w = d
j.o = c
k.o = c
assert k.o.z.q.w.txt == "d"