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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.r: E = None
        self.s: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: A = None
        self.t: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: I = None
        self.s: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: H = None
        self.s: G = None
        self.w: D = None
        self.x: D = None
        self.z: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.r: E = None
        self.s: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: A = None
        self.t: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: I = None
        self.s: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: H = None
        self.s: G = None
        self.w: D = None
        self.x: D = None
        self.z: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: A = None
        self.txt = txt

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

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