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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: G = None
        self.v: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: H = None
        self.t: H = None
        self.v: H = None
        self.y: I = None
        self.q: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: G = None
        self.v: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: H = None
        self.t: H = None
        self.v: H = None
        self.y: I = None
        self.q: B = None
        self.txt = txt

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

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