class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: F = None
        self.t: B = None
        self.q: G = None
        self.s: D = None
        self.o: I = None
        self.w: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: D = None
        self.t: H = None
        self.p: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: D = None
        self.t: H = None
        self.p: E = None
        self.txt = txt

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

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

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