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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: E = None
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: I = None
        self.r: G = None
        self.w: A = None
        self.z: G = None
        self.y: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: I = None
        self.z: B = None
        self.t: B = None
        self.r: E = None
        self.p: H = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.y: H = None
        self.s: E = None
        self.u: G = None
        self.o: H = None
        self.z: D = None
        self.q: E = None
        self.txt = txt

m = A("m")
l = B("l")
f = C("f")
h = D("h")
a = E("a")
i = F("i")
j = G("j")
d = H("d")
b = I("b")
n = J("n")

m.z = h
l.w = d
l.r = a
l.x = i
f.x = d
f.w = j
h.u = j
h.r = j
h.z = j
h.s = b
h.w = m
h.y = f
a.t = f
a.q = h
i.y = b
i.z = l
i.t = l
i.r = a
i.p = d
j.z = a
j.t = a
j.r = a
j.v = n
j.w = f
j.s = m
j.y = m
j.x = h
j.u = i
j.q = i
d.q = n
d.v = h
b.p = h
n.y = d
n.o = d
n.s = a
n.q = a
n.u = j
n.z = h
assert i.y.p.z.x.s.p.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: E = None
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: I = None
        self.r: G = None
        self.w: A = None
        self.z: G = None
        self.y: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: I = None
        self.z: B = None
        self.t: B = None
        self.r: E = None
        self.p: H = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.y: H = None
        self.s: E = None
        self.u: G = None
        self.o: H = None
        self.z: D = None
        self.q: E = None
        self.txt = txt

m = A("m")
l = B("l")
f = C("f")
h = D("h")
a = E("a")
i = F("i")
j = G("j")
d = H("d")
b = I("b")
n = J("n")

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