class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: E = None
        self.x: H = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: J = None
        self.p: A = None
        self.t: J = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: I = None
        self.r: J = None
        self.o: J = None
        self.v: J = None
        self.s: I = None
        self.x: H = None
        self.y: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: J = None
        self.r: B = None
        self.q: B = None
        self.o: C = None
        self.y: J = None
        self.w: E = None
        self.v: D = None
        self.u: B = None
        self.p: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: J = None
        self.t: A = None
        self.y: A = None
        self.o: B = None
        self.s: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: H = None
        self.x: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: J = None
        self.p: A = None
        self.t: J = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: I = None
        self.r: J = None
        self.o: J = None
        self.v: J = None
        self.s: I = None
        self.x: H = None
        self.y: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: J = None
        self.r: B = None
        self.q: B = None
        self.o: C = None
        self.y: J = None
        self.w: E = None
        self.v: D = None
        self.u: B = None
        self.p: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: J = None
        self.t: A = None
        self.y: A = None
        self.o: B = None
        self.s: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: H = None
        self.x: F = None
        self.txt = txt

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

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