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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: G = None
        self.w: J = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.u: E = None
        self.o: E = None
        self.t: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: G = None
        self.q: A = None
        self.y: D = None
        self.x: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: J = None
        self.o: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: A = None
        self.z: F = None
        self.r: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: I = None
        self.y: B = None
        self.z: I = None
        self.u: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: G = None
        self.w: J = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.u: E = None
        self.o: E = None
        self.t: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: G = None
        self.q: A = None
        self.y: D = None
        self.x: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: J = None
        self.o: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: A = None
        self.z: F = None
        self.r: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: I = None
        self.y: B = None
        self.z: I = None
        self.u: D = None
        self.txt = txt

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

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