class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: J = None
        self.w: A = None
        self.q: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: G = None
        self.r: G = None
        self.t: G = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: I = None
        self.p: E = None
        self.s: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: G = None
        self.p: I = None
        self.z: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: H = None
        self.u: A = None
        self.r: A = None
        self.s: H = None
        self.z: G = None
        self.t: B = None
        self.x: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: H = None
        self.w: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: J = None
        self.w: A = None
        self.q: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: G = None
        self.r: G = None
        self.t: G = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: I = None
        self.p: E = None
        self.s: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: G = None
        self.p: I = None
        self.z: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: H = None
        self.u: A = None
        self.r: A = None
        self.s: H = None
        self.z: G = None
        self.t: B = None
        self.x: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: H = None
        self.w: A = None
        self.txt = txt

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

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