class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: J = None
        self.u: C = None
        self.y: F = None
        self.v: B = None
        self.p: F = None
        self.z: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: I = None
        self.s: J = None
        self.t: F = None
        self.r: J = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: J = None
        self.x: C = None
        self.v: F = None
        self.o: F = None
        self.u: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: F = None
        self.y: E = None
        self.s: F = None
        self.u: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: I = None
        self.w: I = None
        self.s: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: I = None
        self.s: J = None
        self.t: F = None
        self.r: J = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: J = None
        self.x: C = None
        self.v: F = None
        self.o: F = None
        self.u: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: F = None
        self.y: E = None
        self.s: F = None
        self.u: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: I = None
        self.w: I = None
        self.s: F = None
        self.txt = txt

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

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