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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: C = None
        self.y: G = None
        self.r: G = None
        self.o: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: H = None
        self.z: H = None
        self.q: E = None
        self.x: E = None
        self.t: F = None
        self.u: J = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: I = None
        self.v: I = None
        self.r: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: B = None
        self.z: H = None
        self.t: J = None
        self.w: H = None
        self.v: G = None
        self.u: H = None
        self.x: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: C = None
        self.o: D = None
        self.x: D = None
        self.r: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: C = None
        self.y: G = None
        self.r: G = None
        self.o: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: H = None
        self.z: H = None
        self.q: E = None
        self.x: E = None
        self.t: F = None
        self.u: J = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: I = None
        self.v: I = None
        self.r: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: B = None
        self.z: H = None
        self.t: J = None
        self.w: H = None
        self.v: G = None
        self.u: H = None
        self.x: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: C = None
        self.o: D = None
        self.x: D = None
        self.r: F = None
        self.txt = txt

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

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