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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: C = None
        self.v: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: J = None
        self.z: D = None
        self.p: J = None
        self.u: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.t: B = None
        self.q: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: H = None
        self.v: B = None
        self.q: G = None
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.t: I = None
        self.x: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: F = None
        self.t: B = None
        self.x: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: C = None
        self.v: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: J = None
        self.z: D = None
        self.p: J = None
        self.u: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.t: B = None
        self.q: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: H = None
        self.v: B = None
        self.q: G = None
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.t: I = None
        self.x: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: F = None
        self.t: B = None
        self.x: I = None
        self.txt = txt

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

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