class A:
    def __init__(self, txt: str):
        self.y: I = None
        self.t: B = None
        self.x: D = None
        self.o: B = None
        self.v: I = None
        self.w: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: I = None
        self.w: F = None
        self.s: E = None
        self.y: J = None
        self.p: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: I = None
        self.r: A = None
        self.t: G = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: B = None
        self.s: I = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: A = None
        self.r: G = None
        self.t: B = None
        self.o: F = None
        self.q: E = None
        self.u: C = None
        self.x: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: I = None
        self.w: F = None
        self.s: E = None
        self.y: J = None
        self.p: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: I = None
        self.r: A = None
        self.t: G = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: B = None
        self.s: I = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: A = None
        self.r: G = None
        self.t: B = None
        self.o: F = None
        self.q: E = None
        self.u: C = None
        self.x: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

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

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