class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: C = None
        self.r: H = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: G = None
        self.q: J = None
        self.z: B = None
        self.s: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: J = None
        self.z: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: I = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: A = None
        self.t: J = None
        self.v: E = None
        self.z: F = None
        self.p: D = None
        self.w: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: F = None
        self.u: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: G = None
        self.q: J = None
        self.z: B = None
        self.s: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: J = None
        self.z: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: I = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: A = None
        self.t: J = None
        self.v: E = None
        self.z: F = None
        self.p: D = None
        self.w: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: F = None
        self.u: B = None
        self.txt = txt

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

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

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