class A:
    def __init__(self, txt: str):
        self.y: J = None
        self.r: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: C = None
        self.t: A = None
        self.u: B = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: C = None
        self.t: D = None
        self.u: B = None
        self.z: C = None
        self.w: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: A = None
        self.q: I = None
        self.x: E = None
        self.v: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: C = None
        self.t: A = None
        self.u: B = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: C = None
        self.t: D = None
        self.u: B = None
        self.z: C = None
        self.w: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: A = None
        self.q: I = None
        self.x: E = None
        self.v: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

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

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