class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.s: B = None
        self.q: D = None
        self.r: F = None
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: J = None
        self.o: A = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: I = None
        self.s: F = None
        self.x: B = None
        self.v: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: E = None
        self.q: H = None
        self.z: D = None
        self.t: G = None
        self.v: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: B = None
        self.r: D = None
        self.q: J = None
        self.x: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: E = None
        self.o: F = None
        self.r: A = None
        self.y: H = None
        self.txt = txt

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

c = A("c")
j = B("j")
m = C("m")
n = D("n")
f = E("f")
i = F("i")
d = G("d")
l = H("l")
e = I("e")
a = J("a")

c.o = i
c.r = i
c.s = j
c.q = n
c.u = m
j.w = l
j.x = f
j.o = m
j.q = m
j.v = e
j.y = d
j.p = i
m.t = n
m.z = n
m.w = a
m.o = c
n.q = i
n.s = i
n.p = e
n.x = j
n.v = d
f.w = d
f.x = m
i.s = l
i.q = l
i.r = f
i.z = n
i.t = d
i.v = e
d.w = m
d.p = l
d.s = a
d.o = n
d.z = j
l.v = d
l.p = j
l.r = n
l.x = n
l.q = a
e.w = j
e.t = f
e.o = i
e.r = c
e.y = l
a.w = l
assert f.x.t.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.s: B = None
        self.q: D = None
        self.r: F = None
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: J = None
        self.o: A = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: I = None
        self.s: F = None
        self.x: B = None
        self.v: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: E = None
        self.q: H = None
        self.z: D = None
        self.t: G = None
        self.v: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: B = None
        self.r: D = None
        self.q: J = None
        self.x: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: E = None
        self.o: F = None
        self.r: A = None
        self.y: H = None
        self.txt = txt

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

c = A("c")
j = B("j")
m = C("m")
n = D("n")
f = E("f")
i = F("i")
d = G("d")
l = H("l")
e = I("e")
a = J("a")

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